Is "eye for an eye" the best rationale for punishment?

There are several common rationales for punishment when it comes to sentencing those convicted of crimes.

First, there is the idea of rehabilitation. People should be sentenced in a way to rehabilitate themselves (hence the California penitentiary system's name: California Department of Corrections and Rehabilitation).  The emphasis is on things like drug treatment programs, education, and classes.

Second, there is incapacitation.  This method focuses on the harm a person could cause in the future to rationale putting the person in prison.  That is, if a person is in prison, they no longer have the ability (in theory) to harm society -- they are incapacitated from doing so.

Third, there is deterrence.  Here, we punish crimes to deter persons from committing similar acts in the future.  For example, if people know that to commit murder could result in the death penalty, they should be deterred from committing murder to avoid such punishment.

Lastly, there is retribution or what is commonly called "eye for an eye." When most people think of incarceration and criminal sentences, they think of this rationale. The person going to prison deserves their punishment as it fits the crime. If you cause harm, the system will punish you for your actions.  It is with this form of punishment we turn to a recent bit of news that begs the question whether "eye for an eye" is the best route.

A judge in Ohio recently gave an women convicted of assault by pepper spray a creative option for sentencing.  Her choice: she could serve 30 days in jail or let the victim spray her with pepper spray. The women chose to be sprayed.

This scenario begs the question of what sentencing should be in criminal cases.  If a person commits a harm is not the most appropriate sentence to have the harm done to them? For example, if someone commits a battery should a battery be done to them? Emotionally this feels right but in practice it is fraught with problems.  For example, where would you draw the line? What do you do in cases of murder, rape, theft, etc.? The problems are obvious and this is why most sentences, despite what most people think, are not based on the concept of retribution. In fact, the only true crime that regularly employs retribution as the primary rationale of punishment is in cases where the death penalty is imposed.  Why is "eye for an eye" justified in death penalty cases but for no others?