Psalm 18:21-23 (also Psalm 26)
For I have kept the ways of the Lord;
I have not done evil by turning from my God.
All his laws are before me;
I have not turned away from his decrees.
I have been blameless before him
and have kept myself from sin.
1 Kings 15:5
For David had done what was right in the eyes of the Lord and had not failed to keep any of the Lord's commands all the days of his life - except in the case of Uriah the Hittite.
2 Samuel 24:10
David was conscience-stricken after he had counted the fighting men, and he said to the Lord, "I have sinned greatly in what I have done. Now, O Lord, I beg you, take away the guilt of your servant. I have done a very foolish thing."
Ecclesiastes 7:20 (also Psalms 14:1-3, 53:1-3, 143:2)
There is not a righteous man on earth who does what is right and never sins.
How could David be described as sinless or righteous?
Psalm 18 and 1 Kings 15 appear to be saying that David was either perfect or very close to it, yet we know from both human nature and the record of David's life that this was not the case. There are two things to consider in resolving this. One is that the passages are generalizations rather than literal truth. It seems to me that there are two usages or meanings of "righteous" in the Bible. One is that of Ecclesiastes 7:20, where it refers to absolute moral perfection. The second is where it is used in contrast to "wicked" to describe people whose lives are characterized by faith in and obedience to God, even though those people are not perfect. Examples of this usage are found in Proverbs.1 In another case, Noah and Abraham were described by God as righteous.2 Both men sinned, yet they spent their lives striving to be obedient to God, in contrast to the "wicked" who made no attempt or only half-hearted attempts to do what was right. David met this second definition of "righteous" since his life was characterized by faith and obedience; when he did sin, he repented of it and was forgiven.
The second thing to consider is that the passages may refer to David's following the Mosaic Law, which is different than achieving moral perfection. The Law was a finite set of commands which people were expected to be able to follow,3 but someone who met the demands of the Law would not necessarily be perfect. A good example of this distinction is found in Matthew 19:16-21:
Now a man came up to Jesus and asked, "Teacher, what good thing must I do to get eternal life?"
"Why do you ask me about what is good?" Jesus replied. "There is only One who is good. If you want to enter life, obey the commandments."
"Which ones?" the man inquired.
Jesus replied, "'Do not murder, do not commit adultery, do not steal, do not give false testimony, honor your father and mother,' and 'love your neighbor as yourself.'"
"All these I have kept," the young man said. "What do I still lack?"
Jesus answered, "If you want to be perfect, go, sell your possessions and give to the poor, and you will have treasure in heaven. Then come, follow me."
Note that Jesus did not contradict the man's claim that he had followed the primary commandments, which I expect he would have done if the man had been lying, yet the man still fell short of moral perfection. Likewise David could have followed all of God's explicitly stated commands - hence the passages state, "I have not turned away from his decrees" and "David...had not failed to keep any of the Lord's commands" - without being perfect. Of course, in reality he didn't follow even the Ten Commandments perfectly, for he committed murder and adultery; though Psalm 18 (and perhaps Psalm 26) was written prior to his affair with Bathsheba and it's possible that he had followed the Law nearly perfectly up to that point.
Did David sin only in the case of Uriah, or also in taking the census?
David did sin when he took the census, because he took pride in the strength of his army instead of trusting in God's strength. However, he repented of the sin on his own, even before being punished.4 His adultery with Bathsheba and murder of Uriah were greater sins, and he didn't repent of them until he was rebuked by God.5 Thus it could be said that the one case where David persisted in opposing God was in the matter of Uriah and Bathsheba.
1. Proverbs 10:20, 10:30, etc. (Back to article)
2. Genesis 7:1, 15:6 (Back to article)
3. Deuteronomy 30:11-14 (Back to article)
4. 2 Samuel 24:9-12 (Back to article)
5. 2 Samuel 12:1-13 (Back to article)
Other responses (offsite)
Top of page