David was a godly king, but not even he could live a perfectly sinless life. God knows that and has made provision for every human being, including kings, to deal with their sin: confession that leads to forgiveness.
The darkest spot on David's record was his infamous affair with Bathsheba, the wife of one of his loyal soldiers (2 Samuel 11). A train of sin that began with lust and ended with the death of the child of adultery included complicity in murder as David eliminated Bathsheba's husband. David's sins would have been grievous enough if he had confessed them immediately. But he concealed them for almost a year, adding deceit to his sins, and only confessed them when a prophet from God called him to account (2 Samuel 12). To his credit, he confessed—but two of his psalms suggest he should have confessed sooner.
The superscription to Psalm 51 tells us it was written in the aftermath of David's affair with Bathsheba. It appears to be more of a psalm of penitence, of restoration, following his confession. Psalm 32—written by David but not directly connected to the Bathsheba incident—is clearly a psalm of confession. Even if it is a record of David confessing some other sin, it clearly reveals why confession of sin should be immediate: "When I kept silent, my bones grew old through my groaning all the day long. For day and night Your hand was heavy upon me; my vitality was turned into the drought of summer" (Psalm 32:3-4).
When sin is confessed instead of concealed, everything changes: "I acknowledged my sin to You, and my iniquity I have not hidden. I said 'I will confess my transgression to the Lord,' and You forgave the iniquity of my sin" (Psalm 32:5). David discovered what the apostle John wrote to the Church: "If we confess our sins, He is faithful and just to forgive us our sins and to cleans us from all unrighteousness" (1 John 1:9).
Back to Psalms