This verse in the psalms has always baffled me until today. How dare David, a great sinner (as are we all) speak to God in this way? How dare he say, "Vindicate me according to MY righteousness"?
God loves the humble. He loathes the self-deceived. David isn't righteous at all, even though he's certainly suffered a lot, and he probably had some good traits. Is David deceiving himself about his own goodness? No, he's aware of his sin. But ... "vindicate me according to my righteousness"?
There are times in life when a person desperately needs to be vindicated -- he is being cruelly treated, unfairly maligned, made despicable in the public eye. He has an enemy. The enemy has the upper hand. Maybe this person has done wrong -- maybe he's done a lot of wrong. But in this particular instance ... on this one day ... the thing done against him is utterly, undeniably, wicked and evil.
You may wonder why I'm rambling on this way. I have a close friend who experienced this today. It is crushing to my heart, and there's nothing anybody can do about it (except his enemy, who is delighting in victory). Nobody can do anything, except God. This friend is far from sinless and has done plenty wrong, but not in this area -- not in the crushing blow served him today. He is righteous in this matter, and has been made to look evil.
This is when the Christian can say to God: "Vindicate me, Lord, according to my righteousness." In other words: "Don't remember my sins, Lord. Don't bring up the things I've done so badly. But today, please vindicate me in this matter - this sole matter in which I have not done as they're saying I did."
I'm grieved, wounded, disappointed, outraged. I know God is patient, however, and He loves to make us wait. And waiting for justice is good for us. He is the eternal judge. May He rescue those who are wronged and rescue those damaged by deceit and anger.