Verses 1-19
Psalm 51 David's repentance
Having committed adultery with Bathsheba, David then arranged for her husband Uriah to be killed, so that he could take Bathsheba as a royal wife (2 Samuel 11:1-27). The prophet Nathan found out David's sin, condemned him to his face, then pronounced God's judgment upon him (2 Samuel 12:1-15). This psalm displays David's deep sorrow as he confesses his sin to God.
David makes no excuses. He acknowledges his sin and realizes that he can do nothing to receive forgiveness, except cast himself on the unfailing mercy of God (1-2). His wrongdoing has been not merely against a fellow human being but also against the holy God. It is the fruit of a human nature that from birth has been infected by sin (3-5). In the Israelite ceremony for restoring a cleansed leper, a brush made of hyssop was used to sprinkle him with sacrificial blood, and his body was washed with pure water. David refers to this ceremony as he asks God for cleansing from his sin. Once cleansed, he wants to be restored to a life of joy and gladness (6-9; cf. Leviticus 14:1-9).
What David fears most is to be separated from God. He therefore asks God for a new heart, one that is free of sin, so that he might enjoy God's presence and obey God's law as he ought (10-12). In gratitude for such merciful forgiveness he will never cease to praise God, and will always tell people of the salvation God offers to those who turn from their sin (13-15).
The Israelite religious system had no category of sacrifices for deliberate sins such as adultery and murder. Even if it had, David knows that God desires a humble and repentant spirit more than ritual sacrifices. The only thing David can do is come to God in his sorrow, and in a spirit of genuine repentance ask humbly for mercy (16-17).
Because David was king, his sin had dragged his country down with him. He therefore prays that his country also might be restored to God and enjoy God's blessing afresh (18-19).