Psalms 51:14 (ESV)
Deliver me from bloodguiltiness, O God,
O God of my salvation,
and my tongue will sing aloud of your righteousness.
Before we understand the above verse, we have to recall both the writer of it and the purpose of the psalm it comes from. King David wrote this song. It is a confession of a very known moment of his life. He had committed adultery with Bathsheba. That is the reason in Psalm 51 he is confessing his sins. The adultery was about to be known because she became pregnant by it and her husband (Uriah) was out to war (where David should have been). In the cover up of the adultery he attempted and succeeded in killing Uriah. He brought Uriah, a soldier, back from the battle front, hoping Uriah would be intimate with his wife, thus making her pregnancy seem as though it was from Uriah, not David. But, Uriah knowing his men were fighting could not think of sleeping with his wife (note the extra burden this puts on David because instead of being with the warriors he was sleeping with Bathsheba.) This is where the above passage comes in. David sent Uriah back to the front of the war, having him carry the sealed orders to have himself put in the front to be killed. David didn’t kill him, but David made sure the enemy could. This must have haunted David. The guilt of Uriah’s blood was crying out to God for vengeance. David’s guilt was consuming him. This is where God steps in. David not only prays to have the guilt removed, he asks God to replace it with a song of righteousness. What better song of righteousness than to know that God covered his sin, the sin of plotting another’s death. God covered that!! God covers our sins and gives us righteousness:
2 Corinthians 5:21 (ESV)
For our sake he made him to be sin who knew no sin, so that in him we might become the righteousness of God.
He (Jesus) who knew NO sin, and became OUR sin. We, who were full of sin, received HIS righteousness. That is what David prays. God grants him and us that gift: Righteousness in place of a guilt of sin.