ESV - 6 For I desire steadfast love and not sacrifice, the knowledge of God rather than burnt offerings.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
Psa 51:16 says, God desirest not sacrifice; else would I give it: thou delightest not in burnt offering.
This truth is stated twice (Ps. 51:16; 40:6).
God's desire has always been that there be no sin to make it necessary for sacrifices to be offered. David is saying that crimes like his are not to be forgiven by animal sacrifices, that the law does not provide sacrifices to atone for deliberate murder and adultery.
He realizes he is at the mercy of God as his Judge, and such mercy comes from grace, not from law. The law could only kill. It couldn't forgive transgressions of its precepts, nor could it give life unless it was perfectly obeyed.
In Ps 51:17, David says "The sacrifices of God are a broken spirit: a broken and a contrite heart"
Two sacrifices are always acceptable:
1. A broken spirit. Hebrew: shabar (H7665), to shiver; break in pieces; reduce to splinters.
2. A broken and contrite heart. Hebrew: dakah (H1794), to crumble; beat to pieces; bruise; crush; humble (Ps. 51:8,17; 38:8; 44:19); cp. Nakeh (H5223), smitten; maimed; dejected; contrite; lame (Isa. 66:2).
God won't despise a broken and contrite spirit or heart because of His infinite compassion, mercy, and grace which are promised to all who are crushed and beaten to pieces by sin and satanic powers.