From Jack Collins’s “Introduction to the Psalms” in the ESV Study Bible:
Many psalms call on God for help as the faithful are threatened with harm from enemies (often called “the wicked”—frequently the unfaithful who persecute the godly, and sometimes Gentile oppressors). In a number of places, the requested help is that God would punish these enemies. Christians, with the teaching and example of Jesus (in passages like Matt. 5:38-48; Luke 23:34; 1 Pet. 2:19-23; cf. Acts 7:6), may wonder what to make of such curses: How can it possibly be right for God’s people to pray in this way?
Many have supposed that this is an area in which the ethics of the NT improve upon and supersede the OT.
Others suggest that these only apply to the church’s warfare with its ultimate enemy, Satan, and his demons.
Neither of these is fully satisfying, both because the NT authors portray themselves as heirs of OT ethics (cf. Matt. 22:34-40) and because the NT has some curses of its own (e.g., 1 Cor. 16:22; Gal. 1:8-9; Rev. 6:9-10), even finding instruction in some of the Psalms’ curses (e.g., Acts 1:20 and Rom. 11:9-10, using Psalms 69 and 109).
Each of the psalm passages must be taken on its own, and the notes address these questions (e.g., see notes on 5:10; 35:4-8; 58:6-9; 59:11-17; 69:22-28; 109:6-20; and the note on Psalm 137, which contains the most striking curse of all). At the same time, some general principles will help in understanding these passages.
First, one must be clear that the people being cursed are not enemies over trivial matters; they are people who hate the faithful precisely for their faith; they mock God and use ruthless and deceitful means to suppress the godly (cf. 5:4-6, 9-10; 10:15; 42:3; 94:2-7).
Second, it is worth remembering that these curses are in poetic form and can employ extravagant and vigorous expressions. (The exact fulfillment is left to God.)
Third, these curses are expressions of moral indignation, not of personal vengeance. For someone who knows God, it is unbearably wrong that those who persecute the faithful and turn people away from God should get away with it, and even seem to prosper. Zion is the city of God, the focus of his affection (cf. Psalms 48; 122); it is unthinkable that God could tolerate cruel men taking delight in destroying it. These psalms are prayers for God to vindicate himself, displaying his righteousness for all the world to see (cf. 10:17-18). Further, these are prayers that God will do what he said he will do: 35:5 looks back to 1:4, and even 137:9 has Isaiah 13:16 as its backdrop. Most of these prayers assume that the persecutors will not repent; however, in one place (Ps. 83:17), the prayer actually looks to the punishment as leading to their conversion.
Fourth, the OT ethical system forbids personal revenge (e.g., Lev. 19:17-18; Prov. 24:17; 25:21-22), a prohibition that the NT inherits (cf. Rom. 12:19-21).
Thus, when the NT writers employ these curses or formulate their own (as above), they are following the OT guidelines. Any prayer for the Lord to hasten his coming must mean disaster for the impenitent (2 Thess. 1:5-10). Yet Christians must keep as their deepest desire, even for those who mean harm to the church, that others would come to trust in Christ and love his people (cf. Luke 23:34; Rom. 9:1-3; 10:1; 1 Tim. 2:4; 2 Pet. 3:9). Hence, when they pray for God to protect his people against their persecutors, they should be explicit about asking God to lead such people to repentance.
With these things in mind, then, it is still possible that the faithful today might sing or read aloud even these sections of the Psalms, if it takes place in a service of worship, under wise leadership, for the good of the whole people of God.