When the Bible uses the word “sacrifice,” it doesn’t mean our modern idea of doing without or giving up something. Instead, it speaks of an offering that we take to the Temple and give to God. It cost the one making the offering both time and resources and was a very important religious activity in the Biblical world.
Consequently, we might think that a sacrifice “pleases” God much more than just a “prayer.” But this verse makes it clear that the character of the presenter (“wicked” vs. “upright”) is much more important than the actual act of presenting a sacrifice or offering.
While an animal sacrifice at the Temple took a lot more time and effort (let alone expense!) – the LORD hates it when it is not brought with the right heart attitude. At the same time, just an honest, simple prayer by an upright person really pleases Him. With God, it has never been about the gift or the effort, but always about the heart.