I think punishment versus revenge is a false dichotomy. There seem to be aspect of both represented in the Biblical accounts of hell, but they are not the primary purpose of that dreadful destination.
Here's a basic representation of hell as punitive:
Revelation 20:1-3 (HCSB)
1 Then I saw an angel coming down from heaven with the key to the abyss and a great chain in his hand. 2 He seized the dragon, that ancient serpent who is the Devil and Satan, and bound him for 1,000 years. 3 He threw him into the abyss, closed it, and put a seal on it so that he would no longer deceive the nations until the 1,000 years were completed. After that, he must be released for a short time.
The imagery here is of God putting an evil-doer somewhere he can't cause trouble. It's not entirely clear that "the abyss" is Hell proper or the same destination that is mentioned a few verses down. But it is something very like what we usually think of as Hell. This conception of Hell as a prison makes sense with your explanation of punishment being a general good for a society. The New Jerusalem certainly won't be a very pleasant place if the ancient serpent is still hanging around causing trouble.
A few verses later, we see the "hell as revenge" picture:
Revelation 20:7-10 (HCSB)
7 When the 1,000 years are completed, Satan will be released from his prison 8 and will go out to deceive the nations at the four corners of the earth, Gog and Magog, to gather them for battle. Their number is like the sand of the sea. 9 They came up over the surface of the earth and surrounded the encampment of the saints, the beloved city. Then fire came down from heaven and consumed them. 10 The Devil who deceived them was thrown into the lake of fire and sulfur where the beast and the false prophet are, and they will be tormented day and night forever and ever.
The key phrase is the final one: "they will be tormented day and night forever and ever." You can't really say that this is about keeping bad actors out of good society, since they are going to be tormented always and forever. You don't have to look hard to see that the God of the Bible has powerful emotions. The passage you quoted in Romans shows that God reserves vengeance to Himself and Revelation 20 is a description of how He will avenge Himself.
While we are here, the idea of people being tortured forever for committing particularly heinous crimes was far more socially accepted in those days than it is in ours. Perhaps part of our current squeamishness on the topic come from Western society's strong Christian influence that tells us that we ought not to wish bad things on our enemies. This is to the good, but it does make having a correct theology of hell a bit more difficult if we apply the principle to God Himself.
When we think of people "going to Hell", we are usually thinking of passages such as:
Revelation 20:15 (HCSB)
15 And anyone not found written in the book of life was thrown into the lake of fire.
But we need to back up in order to see what is meant by the "book of life":
Revelation 20:11-12 (HCSB)
11 Then I saw a great white throne and One seated on it. Earth and heaven fled from His presence, and no place was found for them. 12 I also saw the dead, the great and the small, standing before the throne, and books were opened. Another book was opened, which is the book of life, and the dead were judged according to their works by what was written in the books.
So there are two sets of books:
- Books that record the works of all people, great and small.
- The book of life that records the names of people who are saved from Hell.
The strong implication here, which is confirmed in the rest of the Bible and most especially Romans, is that everyone will be condemned by the first set of books. God's justice demands that Satan's charges against us be punished according to our deeds. As for myself, and I imagine all honest readers, the judgement is eternal torture. (My personal torture, according to the classic Greek tradition, would be a library of all the books every written and infinite time to read them, but just as I start to open a page someone with an urgent task that I can't put aside will prevent me from reading.)
Thankfully, God's accounting system includes a second book that allows anyone whose name is recorded to be released on what might be called a technicality. As it turns out, the reason God is able to refer to the book of life is that He demonstrated perfect love by substituting His Son as a sacrifice to cover our sins. God can give us the gift of life:
Revelation 22:17 (HCSB)
17 Both the Spirit and the bride say, “Come!” Anyone who hears should say, “Come!” And the one who is thirsty should come. Whoever desires should take the living water as a gift.
Perhaps the primary purpose of the church is to say to all who will listen, "Come!" because God offers life to all who will take it. In the end, the accounting of Mercy trumps the accounting of Justice. Without the Cross, Hell is the proper destination for all of us who have been tainted with Adam's sin. With the Cross, Hell shows us what God's ultimate sacrifice rescued us from. It is God's way of illustrating the extreme (and rightful) consequences of our sin without His intervention.
Struggling with God
Finally, I would like to personally encourage you (and anyone else who struggles with this question) to continue to challenge God on this. Don't accept easy answers (not even mine). Remember that in the end God blessed Job even though he directed his anger at God and dared to charge Him with wrongdoing. (I've been doing a lot of thinking about Job lately.) As Paul says on the topic of perfect, self-sacrificial love:
1 Corinthians 13:12 (HCSB)
12 For now we see indistinctly, as in a mirror,
but then face to face.
Now I know in part,
but then I will know fully,
as I am fully known.
We can't yet be fully pleased with the answers we have because they aren't complete and clear. We dare not give up on seeking answers from God until He reveals all to us at the end of the age.