Is it morally acceptable to punish? And at what stage does punishment turn to revenge? Comparing something like lex talionis (which seems like revenge) with rehabilitative/correctional systems (which seem restorative), it seems that certain forms of punishment are more ethical than others.

What is quite interesting about the lex talionis ("an eye for an eye....") is that it functioned to limit retaliation (e.g. if my neighbor injures my eye, I am not thereby authorized to kill him and his family). In any case, there are many theories of punishment. These include the notion of retributive justice, the communication theory of justice, utilitarian theories, and so on.

Keeping this reply short, you might consider a thought experiment (not my own) that will test your views about punishment and revenge. Imagine someone has done great harm to those you love --imagine a case in which someone killed a member of your family due to driving while intoxicated. Consider now two possibilities: in the one the person is punished (proportionately) and through this he comes to understand that what he did was wrong (imagine that until this event he lived as though he had little or no responsibility for others). Imagine, too, that through this process he becomes rehabilitated and even (when released from jail) he works to make financial compensation for the famiies and dependents that were injured. Now consider a different option: through either psycho-surgery or chemicals the wrong-doer can be instantly changed to a rehabilitated state and motivated to make the same compensation. In this case, you get the same end point, but without the punishment. Do we miss something in the second case that we have in the first?

The thought experiment may be flawed after all, would we ever know that psycho-surgery or chemicals could guarantee the results? but I think we do miss something when punishment is missing. Punishment serves to institutionally remove any pleasure from the wrong-doing and (at its best) provides a more rooted foundation for reform than the imagined chemical and surgical interventions. Still, institutions of punishment in the real world (and not just in thought experiments!) are often deeply flawed, and so any final, practical philosophy of punishment will need to take into account not just the ideal but the probable outcome of this or that punishment.

A final note on revenge: at least two things may distinguish a just punishment from revenge. The latter is often personal (e.g. if I am injured, I want to be the one who inflicts harm) and, unlike the lex talionis, has no upper limit.

Read another response by Charles Taliaferro
Read another response about Punishment