John Walton observes that there are no real parallels to the imprecatory Psalms in Ancient Near Eastern hymnody (Ancient Israelite Literature in its Cultural Context, 147). That is no accident:

“In the monotheism of Israel, the suffering of the righteous constituted a much more serious problem than it did in the polytheistic system of Mesopotamia. If YHWH was just and the retribution principle was true (both firmly believed by the pious Israelite), then the punishment of the wicked in proportion to their wickedness was a theological necessity. While it is impossible to claim that there was no personal vindictiveness motivating the psalmist to his imprecations, at least we can see that there are other important motivations for these curses. God’s reputation as a just God is at stake if personal disasters such as those listed in the imprecatory psalms do not overtake the enemies of the psalmist. The absence of such requests in the Mesopotamian laments certainly reflects the greater complexity of polytheistic theology. It may also reflect less confidence on the part of Babylonians regarding what the gods were obliged to do to protect their reputations.”

Imprecations are not barbaric blemishes on the Psalms. They are expressions of Israel’s view of Yahweh’s character, and of Israel’s hope in the justice of Yahweh.