Can we take actions that are godly but in which God isn’t pleased? Yes. Adam and Eve had done so. In their actions the sin of pride hid itself. We sometimes don't easily see our sins. And very often as believers and ministers the enemy fools us. But God wants us to know good and evil but for us to choose good.
Now this is why we need the wisdom of Christ and the empowerment of his Holy Spirit. Paul tells us the battle is all against spiritual wickedness in high places. We need the armour of God to which we have easy access as believers through Jesus Christ. We can’t overcome the devil with our own strength. Look how the apostle Peter and the other disciples, without the Spirit, handled the arrest of Jesus Christ--though he repeatedly told them what will happen. They hid in fear and we know even Peter on three occasions publicly denied that he knew Christ.
But once he had the Spirit of Christ he wasn’t afraid at all. This Spirit came upon him at Pentecost. Peter was the one who stood up boldly saying to people and defending the speaking of tongues when the Spirit came upon them like a gushing wind. He was brave, bold, confident and unafraid to speak on behalf of Christ and the gospel.
Jesus had to tell his mother at the wedding of Cana that it wasn’t yet his time, though he later performed his first miracle there. Often the Bible records how he disappeared from the crowd at some points of danger to his life. Was he afraid? Of course not. He still had much to do according to prophecies and the will of the father. Notice that just before he died on the cross he said "it is finished."
Scripture explained that he uttered these words as he knew that he had fulfilled all the prophesies he was called to do and that he did all that he was commanded to do by God the father. So timing was important for we notice too that he didn’t run from the incoming soldiers who came to arrest him. That was the time for that to happen. So here Jesus demonstrated that obedience to God is better than life itself--he showed the importance of staying in the will of God even to the point of death--even death on the cross.
Normally, and that is what King Saul knew, in Old Testament times, sacrifice and animal burnt offerings were made to The Lord. So when Saul had conquered the Amalekites under Gods commands, he kept back some of the best animals in spite of God's commands and told Samuel when challenged for doing so, why he didn’t kill all the animals. Samuel made a point in telling Saul that God prefers obedience to sacrifices.
So the point here again can be seen that though Saul had done what would have been normally considered a righteous and holy act, it wasn’t what God desired at that time--it wasn’t in accord to his will and purposes at that time. So it was godly but not God’s will.
We make this mistake even in our secular lives. The best guideline is that we must keep in sync with God's purposes. I think the most classical example on this point is the action of Adam and Eve. God punished them as they violated his command. He specifically told them not to eat of the tree of good and evil. They disobeyed him and now humanity is in the mess in which it is today. But throughout the Bible God encourages us to know good and evil but to choose good. In our choices today, choose Christ as Lord and Saviour (John 14:6).