Justice and revenge are all about what is "fair". People draw conclusions on too little of information which is why they believed the earth was flat and that there are spiritual reasons for the physical sun "rising and falling". To know what is fair justice you would have to be the other person to know how difficult the decision was for them to do or not do and whether or not they are in control at all. We dont know those things and we punish people according to dogmas which are one of many that are all contradictory. It would be better to say i dont know so as to avoid becoming a bad guy yourself. But everything that is objectively wrong is unfair. It would be wrong to give one of your kids enough food to make two people fat while you give none to one kid. That ones pretty simple which is why i used it. When you hurt someone who hasnt hurt anyone their self its wrong because they dont deserve it. If they dont deserve it then its unfair to do it to them as this gives you an unjust advantage. We punish people just in case they deserve it while we should show mercy just in case they dont. That doesnt mean we have to let them continue to hurt others. We just dont have to make them miserable by putting them in a place where their fate is determined by their size instead of what they deserve.
We should strive to maximize positive outcomes and negative outcomes. While unfairness is negative and fairness is positive they are not the only things that positive and negative.
The important question with punishment is what results are we encouraging? Not just how will it change the person who is punished but how will it set an example to influence other people's behavior.