David approaches God after being confronted with his own sin by Nathan the prophet. Through use of a story, Nathan the prophet caused David to see his own wickedness in committing adultery with Bathsheba, then indirectly killing her husband as an attempted cover-up (2 Samuel 11:1-12:25).
Knowing that he has nothing to offer God as a sufficient sacrifice for his sin, David appeals to the lovingkindness and compassion of God. He realizes that he needs something deeper than even forgiveness of sins. He comes to terms that sin is a condition of the heart, that he has been born with this condition and nothing short of cleansing and washing will allow him to reach truth in his innermost being and to know the wisdom of God.
The deep repentance of his own culpability leads him to cry out to God for a new, clean heart. David also realizes that the new heart will need the Spirit of God to allow him to continually be in the presence of God. Then he will experience the joy of God’s salvation.
As David looks to this new, clean heart, he can see the calling of the pure heart. The beat of this new heart is one of redemption. In his transformation, he will teach transgressors and sinners the way back to God.
David understands that God doesn’t care about animal sacrifices and religious performance, if there is no heart behind them. God’s delight cannot be purchased. God desires us to live in humility and obedience toward Him. He wants us to hate sin, and to love and obey Him starting from within our hearts.
David foresees that, after being healed and given a new heart, he will be a worshiper of God and sing and declare His praises to all people. David prays for the people that their own worship and sacrifices can be seen as righteous by God. Worship ought to be more than a ritual or tradition. Worship should be a lifestyle that flows from the inner being of a pure heart given by God.