Self-reflection
See, one of the qualities David had which made him such a great king was his absolute honesty with himself and with God. He had no delusions as to his position - even though chosen by God Himself, David knew better than to think he was great.
He knew, without a doubt, that he was a sinner: Wash away all my iniquity and cleanse me from my sin.- Psalm 51:2. (This was written after the Bathsheba incident)
David never had any pretenses with God. When he sinned, he admitted it. He asked God to cleanse him, instead of cooking up excuses to justify his actions.
He even asked God to cleanse his hidden sins. David knew that God knows him better than he does himself; after all, God created him!
Psalm 139:23-24 was, in effect, a prayer to God to purify him.
David always emphasised the importance of self-reflection: Psalm 4:4 - ...when you are on your beds, search your hearts and be silent.
And he's right. I've seen people who deceive themselves, and it isn't a pretty sight. Most do it out of fear, and not all are conscious that they deceive themselves. They try to run away from who they are, not wanting to face reality.
It makes them susceptible to the devil's lies, makes them easy prey, because once they shut their eyes to truth, they can't recognize it anymore.
The reluctance for self-reflection leads to self-destruction.