Psalm 52 is an imprecatory psalm (cursing psalm). For a general discussion of this genre of psalm see the article provided here on this. Psalm 52 specifically declares the cursed state of those who not only do evil but who delight in and boast of evil. This is a psalm of indignation against injustice and evil. David here expresses disturbance at evil and in this he shares the sentiments of God. It is important to note that those who are being targeted here are not broken and repentant sinners. These ones are precisely those whom God mercifully seeks, as was demonstrated in the life of Christ. The people whom David is railing against here are those who are proud of the evil they do and who delight in the things that God hates. The declaration that David makes is blunt and simple. ‘God will bring them to everlasting ruin.’ The psalm therefore contains a strong sense of eschatological anticipation (that is, a longing for the coming of Christ in the end times). The new testament exhorts us throughout to long for what God is going to bring about at the end of the age. We are not to wallow in the present but to live with out spiritual eyes looking out for the coming of Christ. The heart of the Christian is a heart that both joyfully and painfully cries out, ‘Come Lord Jesus!’ But when we take up this biblical call we are calling, amongst other things, for the judgment of God. The second coming of Christ will be, as Isaiah prophesied, ‘the day of vengeance of our God’ (Isaiah 61:2b). It will be a day when unrepentant evil doers are judged with a terrible outpouring of the just anger of God. What this psalm expresses therefore is the longing for that day of judgment; it simply pronounces the sure judgement of God upon evil.
The idea of the righteous laughing and rejoicing at the destruction of evil doers is hard to take for us now. But maybe it would be easier if like David we had seen our country and our family ravaged by the emissaries of evil. Justice is the delight of those who have tasted the bitterness of injustice. The only thing greater than this is repentance and mercy, although, as with Jonah before the repentant Ninevites, this was not always easy to accept. Justice is further expressed here in the declaration that one who refuses to trust in God will finally see that their evil design for god-like independence at the expense of others end in disaster. It is a moment of vindication for those who trust in God but do not always see immediate physical benefits of this while the ungodly all around often seem to have more (as was the struggle for the writer of psalm 73).
In the last part of the psalm David declares that he is better off than the evil doers, not because he has more, but because he is planted like an olive tree in the house of God. It is his relationship with God that makes him richer than those who forfeit this for worldly gain. The act of comparing the lot of the ungodly with the godly is an important avenue of reflection in the psalms. By declaring the cursedness of the ungodly life and the contrasting blessedness of the godly life we thereby dissuade ourselves from joining with the former. This is an important role of the imprecatory psalms, that is, they are an indirect exhortation to godliness in the light of the coming judgment. They are not just about denouncing evil. They are very much concerned with warning against the evil in our own hearts.