1 Samuel 15:10-23 (NASB):
Then the word of the Lord came to Samuel, saying, “I regret that I have made Saul king, for he has turned back from following Me and has not carried out My commands.” And Samuel was distressed and cried out to the Lord all night. Samuel rose early in the morning to meet Saul; and it was told Samuel, saying, “Saul came to Carmel, and behold, he set up a monument for himself, then turned and proceeded on down to Gilgal.”Samuel came to Saul, and Saul said to him, “Blessed are you of the Lord! I have carried out the command of the Lord.” But Samuel said, “What then is this bleating of the sheep in my ears, and the lowing of the oxen which I hear?” Saul said, “They have brought them from the Amalekites, for the people spared the best of the sheep and oxen, to sacrifice to the Lord your God; but the rest we have utterly destroyed.”Then Samuel said to Saul, “Wait, and let me tell you what the Lord said to me last night.” And he said to him, “Speak!”
Samuel said, “Is it not true, though you were little in your own eyes, you were made the head of the tribes of Israel? And the Lord anointed you king over Israel, and the Lord sent you on a mission, and said, ‘Go and utterly destroy the sinners, the Amalekites, and fight against them until they are exterminated.’ Why then did you not obey the voice of the Lord, but rushed upon the spoil and did what was evil in the sight of the Lord?”
Then Saul said to Samuel, “I did obey the voice of the Lord, and went on the mission on which the Lord sent me, and have brought back Agag the king of Amalek, and have utterly destroyed the Amalekites. But the people took some of the spoil, sheep and oxen, the choicest of the things devoted to destruction, to sacrifice to the Lord your God at Gilgal.” Samuel said,
“Has the Lord as much delight in burnt offerings and sacrifices
As in obeying the voice of the Lord?
Behold, to obey is better than sacrifice,
And to heed than the fat of rams.
“For rebellion is as the sin of divination,
And insubordination is as iniquity and idolatry.
Because you have rejected the word of the Lord,
He has also rejected you from being king.”