Truth be told, I sometimes have a little problem with Psalms like #26. Didn't Jesus encourage us to be humble in our prayers and offer confessions for our sins? In Psalm 26, however, David gives us a model that basically says, "Look at me, God! I'm holy! I'm righteous! Take care of me, Lord, because I'm one of the good ones!"
Is this really how we ought to pray? Is arguing our righteousness before God the way we earn His favor? Should we even be attempting to "earn His favor" like some kind of teacher's pet?
I don't want to be too hard on David. After all, he wrote so many of the Psalms he must have known what he was doing! (Even just one psalm would be more than I have written!) A critical spirit is probably not an improvement upon a self-righteous one. And besides, who am I to judge that David is being "self-righteous" here? Maybe he is being just plain righteous and is reminding God of his faithfulness?
But I still don't think God needs to be told and reminded of our goodness. A healthier way for me to read this psalm is to view it as aspirational. In other words, for those of us who have not yet attained this kind of righteousness, it gives us a picture and a target to shoot for. And for those who are walking in faithful obedience like the psalmist, it reminds us that holiness is important to God and something for which we should strive. After all, the same One who told us to act without hypocrisy also told us to be perfect, just as our Father is perfect. We are all on that continuum somewhere - Psalm 26 shows us what it looks like to move closer to God.