In 1 Samuel 22, as David is recounting the faithfulness of the Lord, he says this:
“The Lord dealt with me according to my righteousness;
according to the cleanness of my hands he rewarded me.
For I have kept the ways of the Lord
and have not wickedly departed from my God.
For all his rules were before me,
and from his statutes I did not turn aside.
I was blameless before him,
and I kept myself from guilt.
And the Lord has rewarded me according to my righteousness,
according to my cleanness in his sight.
Now, we may glance over this passage at first, but I want to point something out. The murdering, adulterous, coveting King of Israel claims that he “did not turn aside” from God’s law. He says that God rewarded him according to his own (David’s) righteousness.
How can this be?
Does David really believe himself to be righteous?
Does he not understand how human sinfulness works?
Didn’t he write the words “there is none righteous, no not one”? Did he forget about that?
I doubt it.
So how can David say this?
Well, there are at least two answers that spring to mind. First, we have to remember that God’s “law” does not refer only to the rules in the first five Old Testament books. It refers to the totality of God’s word to His people. His “law” is His instruction, or teaching, which is what the word “law” means in Hebrew. With that in mind, we can point to another Psalm that gives us insight into David’s reasoning. Psalm 51 says this:
O Lord, open my lips,
and my mouth will declare your praise.
For you will not delight in sacrifice, or I would give it;
you will not be pleased with a burnt offering.
The sacrifices of God are a broken spirit;
a broken and contrite heart, O God, you will not despise.
God’s desire from His people is not first physical of obedience and adherence to His rules, it is their hearts. God wants us to come humbly before Him, confessing sins and seeking His grace. This is the mark of a heart that is righteous before God, and David has proven himself to be humbly repentant of his sins against God. So, in that sense, he is righteous, for he has kept the spirit of the law.
The second reason is this: David is speaking about a righteousness that the world had not seen yet. He is prophesying. I don’t think he knows it, but God does, and God is using David’s words to show us something about His goodness toward His people. David says that he is blameless, clean, free from guilt, and righteous, but even if he is repentant for his sins, he still sins. He is not, and will never be, perfectly righteous unless God makes him that way. And He has. God has made righteous those whom He has called. Romans 8:30 tells us that God justifies the ones that He has called. How does this justification, this making righteous, happen. by His grace as a gift:
For all have sinned and fall short of the glory of God, and are justified by His grace as a gift
In the mystery of God’s grace, He placed His own righteousness on those whom He saved by the blood of Christ. So, in a very real way, David can claim God’s righteousness as his own because God has given it to him fully and freely. And He has given it to us as well. If we trust in Christ, we are righteous before God. And this righteousness is ours, not because we earned it, but because it was given to us. We have been gifted with the very righteousness of God, so that we can say with David, “Gad has rewarded me according to my righteousness (which He has given me in Christ) and I have been found worthy in His sight.” Amen to that!