David wrote this psalm as an expression of his repentance for the particular sins he committed when he broke God’s law in connection with Bathsheba and her husband Uriah. Yet his words are more than a personal confession – the psalm is also a method of teaching how we should speak to God after we have sinned (teaching divine truth was a role that David had as a king and as a prophet).
About a year passed between David’s wrong actions and his repentance. Sadly his sins had blinded his mind to what he had done. David does not seem to have realised the awfulness of what he had done until God sent Nathan the prophet to confront him. The effect of Nathan’s message should remind us that the word of God clarifies a situation, which it did for David and he realised the dreadfulness of his actions.
Part of David’s concern would have been the matter that the Levitical law did not contain sacrifices for adulterers and murderers. Yet David was able to see by faith beyond that limitation and go directly to God and ask for mercy and cleansing. The psalmist realised that the most heinous aspect of his actions was his rebellion against God’s law (as a king, David would have regarded very seriously any rebellion by his subjects, and he realised that God was his King). So his faith had to focus on aspects of God’s character that were suitable for the situation – his mercy and his faithful love (vv. 1-4).
David knew that the root cause of his wrong actions was the sinful nature he had inherited at birth (v. 5). Yet his sinful nature did not excuse his action; instead it increased the gravity of his offence. Therefore he prayed for ongoing inner renewal from God. At the same time, he knew that when God forgave him, he would have spiritual joy. This aspect is one that many find hard to understand – how can a guilty person experience joy? The answer is that it is a special joy that accompanies reconciliation with God (vv. 5-8).
David expands his requests in verses 9-15. He asks God not to look at his sins; instead he asks the Lord to blot them out (and if God blots them out, who can see them?). David’s iniquities have made his character ugly, but he knows God can remove that ugliness and replace it with the beauty of a clean heart and a right spirit. The psalmist also wants to enjoy fellowship with God, therefore he prays specifically for the inner work of the Holy Spirit. And through the Spirit’s presence, the psalmist will not only experience joy, he will also become a means of spiritual blessing to other sinners (including all those millions who down the centuries have benefited from his teaching in this psalm). David understands that salvation is not only from sin, it is also for consecration. Therefore it is not surprising that David’s intelligent faith could place confession of sin to God alongside desires of living to the praise of God.
In verses 16-19, David describes true worship, whether in private or in public. What matters most is not the ritual (burnt offerings) but the inner state of the worshipper (a broken and a contrite heart). The ritual is important (God had prescribed it), but it is meaningless without a right state of heart. When the Lord answers prayers for inner penitence, our worship will then be pleasing to him and churches will prosper (illustrated by walls of Jerusalem being erected). A clear lesson is that before we participate in his worship we must have the right inner attitude of penitence for our sins. And it is a reminder that one reason for a lack of church growth is the absence of repentance.