In addition to not praying for understanding of his enemies, many of us are further disturbed and even offended by David's consistent prayers for complete and violent judgment on them. When discussing our discomfort with this, the historical and cultural realities of David's time are often given to provide background and soften the blow somewhat. Regardless of these considerations, I'd like to suggest David's view of judgment is spot on and essential to our faith and prayers.
While the Psalms give insight to David's persona and circumstances, their primary, overriding, God-breathed intention is to form the prayers of God's people. They have been the prayerbook of Israel, and later the Church, through the centuries. God uses them to teach us how to relate to Him amid the realities of a world broken and ravaged by sin.
One of the postmodern assertions to which I respond negatively is that God doesn't judge. This is not just a little off; it is wholly false. Not only does God judge, He always judges. That's who we need Him to be—if this is in doubt, those doubts probably spring from lives of apparent privilege and relative freedom from oppression. These are only apparent and relative, however. The truth is that we live in a world constantly opposed to God's sovereign intention, that until and unless He delivers us, we are constantly under the yoke of an enemy whose objective is the destruction of our souls. If we're given enough comfort in this life to doubt or disbelieve that reality, only the enemy's purposes are served. This world requires judgment, and if we are to be delivered, we need it, too.
Sin and wickedness (words that often seem so far from us except in the moments when, by God's grace, we can be honest with ourselves) must be punished and, ultimately, utterly destroyed. If God does not do this, He is not just. If God does not do this, He is not good. And it must all be dealt with in this way; He cannot leave a little lurking in a darkened corner and a smidge swept beneath a rug. David's prayers reflect this reality in concrete terms.
The reality of these prayers creates a context for God's grace. That's where Jesus comes in. I'm getting very excited for Part III.