The dilemma to answer here is what justification is there for using harm to prevent harm? The legal process can lead to fines, imprisonment and other punishments on someone for harms they have committed, but this imprisonment and other actions are also prima facie harms. We will examine how these can be justified here.
Ethics, Value and Prescriptions
We have explored how the desire fulfillment theory of value can provide a basis for ethical value, that by taking everyone's interests (desires) into account one can determine the ethical value of a desire by its material effects on all those other desires. If it's presence is more likely to thwart or tend to thwart other desires - to harm or hinder others' ends - it is unethical and if it's presence is more likely to fulfill or tend to fulfill other desires - to help or benefit others' ends - it is ethical. We have also explored how the externalist reason to act theory of prescriptions can provide prescriptions both to have reason(s) to act that a person lack(s) or or remove reason(s) to act that a person has, determined in terms of how ethically valuable those desires (reasons to act) or, the lack of them, are.
Still this implies that if acting on desire thwarting desires are ethical harms or unethical, so what can be the justification for both the legal responses such as fines, imprisonment and other punishments - which is also acting on a desire thwarting desire and so are prima facie harms too and, also, those pre-legal and informal actions such as thwarting someone's desire thwarting desires in general? How can one distinguish between competing desire thwarting desires, that is, competing harms?
The Reality of Desire Thwarting
First of all, in day to day life, people's desires are already being thwarted - and some of those cases specifically by others' actions. One of the basic motives behind social forces is to discourage others from thwarting your desires, as they too discourage your actions from thwarting their desires. One means of this discouragement is to prevent or stop the actions of others that prevent your desire being fulfilled, as they might they might prevent or stop your actions that prevent their desires from being fulfilled. That is your or others desires are reactively thwarted, if you or others did not have the desire thwarting desires in the first place, there would be no action to react against. This is one of the means through which we and others learn as to whether our desires are desire thwarting to others desires. If mutual social conditioning is effective then you and others will not have or act on (make effective) desire thwarting desires, if it fails or is in the process of being applied, you or others might have desire thwarting desires that are thwarted rather allowed to be fulfilled.
This assumes that everyone is being coherent in only focusing on preventing such desire thwarting and consistent in application, without those assumptions the amount of desire thwarting gets worse. Still is not a reactive desire thwarting action also a prima facie harm, if, and especially if, the desire that one is reacting against is, in fact, harm too? Just because this is how we do things, is this a justification for doing it?
Coherent and Consistent Social Forces
For social forces to be effective there needs to be methods to challenge and update each other's desires. The positive social forces of praise, commendation, honor and the negative forces of condemnation, criticism, dishonor work expressively to change one's motivations. The material forces of reward and punishment can also be used. The expressive methods work with a properly socialized person through, for example negative expressions, generating emotive or affective reactions such as shame, embarrassment and guilt, reactions that can modify one's internal set of desires, which was the purpose of the negative expressions. The material means can help build these necessary emotive reactions - to help socialize a person - so that the material options are eventually not needed as expressive methods become more effective. This is particularly the case with children where the material punishments do not have to be directly physical - no pocket money, no internet or computer gaming etc. Still this does apply to adults, especially those who have inconsistent or inadequate socialization as a child. All we are noting here is that various material forms of desire thwarting are reactively carried out so that eventually one can use expressive social forces alone.
So there is a fourfold justification for reactive desire thwarting. First that it must be, in fact reactive - and not proactive. The second is that its purpose of this is to discourage future desire thwarting and third to enable no-material expressive methods to be used to achieve that. Finally that this can be emphasized by preventing current desire thwartinactions, sometimes of necessity. The last three points are justified if there is a net benefit. This is all very wel but who decides all this? Disputes can arise - is there a net benefit? Who started it first - is this really a properly reactive action? Is the reactive desire thwarting proportionate to the initial desire thwarting desire? Are there effective and efficient means for dealing with these disputes and preventing them?
Efficient and Effective Institutions
Well we can only go so far with informal means of social conditioning and, apart from what was noted above, there are many factors that can subvert this process - make it unfair - due to differential opportunities, abilities, education, money, power, status, connections and other resources . It is also inefficient for each and everyone to try and apply this, all are motivated to maximize their own values, to have their own desires fulfilled, but acting independently, ceteris paribus, more work is required to prevent others thwarting one's desires, which takes time away from fulfilling one's desires.
Culture exists partly to provide more efficient and effective institutions to achieve one's value. One can evolve informal institutions biased towards one's group's interest - family, clan or tribe within a multi-tribe society - this makes it more efficient and effective for members of that group, efficient as in each individual typically needs to use less time and resources to prevent interference with fulfilling their own desires and effective as the group can more consistently, coherently and powerfully block desires that thwart desires of members of the group. However the problem this served to diminish, can alternatively be amplified, as groups reactively evolve against each other and have different perspectives on desire to fulfill - on what they value. One can end up with the same two key issues - who started it first and are responses proportional.
So most people in a sufficiently large environment of other people, in the interest of efficiency, effectiveness and fairness, end up wanting some form of public service provision - of policing, a civil and criminal justice system and prison services to deal with severe and chronic excesses of desire thwarting - harmful - actions , whether a result of failed or deliberate transgressions of social interactions and to deal with all excesses equally.
Such a formal institution can itself and often has and been corrupted (and, sometimes, even designed to be that way), failing the needs of at least some of its citizens to the benefit of others. A just law would be one that coherently reflects and consistently applies the type of ethical value we have previously analyzed. It would be a means of externally coherently reinforcing those empirical ethical values - to minimize harm and increase mutual benefit to all citizens.
The key questions of such institutions are again - who started it and is the response proportionate - coupled with is this a just - a fair - system, does it coherently focus on unethical actions to reduce those and only those or is this an unjust system - does it criminalize ethical actions - usually on behalf of one group over another - and so distort ethical values?
The challenge of making and keeping a just law system is an ongoing project that everyone should have some interests in, still if we assume that this is the case here we can revisit the specific question of the justification of reactive desire thwarting by the state via such institutions. The basic justification is in terms of benefiting all, and helping make such a process efficient and effective. Again if we grant this here this leaves the question of what is a proportionate response?
Forms of Justice
Once a person has been found guilty of a crime the issue becomes - in a fair and just system - what is the purpose of the punishment. Is it a deterrent - designed to discourage others from pursing the same crime? Is it it protection - designed to protect other citizens from further harms from this person? Is it retributive - designed to right a wrong through punishment. Is it rehabilitative - designed to re-socialize the person so that they can be a beneficial not harmful member of society?
The most problematical one here is the retributive option. It is difficult to justify retribution once the guilty person is no longer able to commit and perpetuate more harm. Since once they are in the system everyone else is protected from future harms of that person. It seems that such a reactive desire would decrease the global value, not increase it. One harm has been done and another has been now done which, arguably. might balance it out, as far as victims and families of the initial harm is concerned. Still if done for this purpose it is decreasing the global value, and this a questionable power to assign to state sponsored public services. Apart from this power being abused - it also sets a precedent and endorses retributive actions for its citizens in general. Such policies serve as influencing the way sdocial forces work in culture. This is quite different to the reasoning behind informal reactive desire thwarting discussed above. As far as an overall position on retributive justice is concerned, lets for now remain agnostic, and focus here on the specific question being addressed here, and provisionally conclude that retribution is not a justification for reactive desire thwarting - formally or informally.
Rehabilitation and deterrence better work with the approach of protection. If rehabilitation works then that person can both rejoin society and society is also protected as that person will not re-offend (ideally of course). Similarly if deterrence works then this serves to reinforce the underlying ethical values and so less are likely to offend in the first place. Since we are concerned with the justification for state enacted prima facie harms, the basic argument becomes that if these harms prevent further harms so there is a net benefit, then they are justified.
How does one know what and how many penalties and punishments are a deterrence? This is an empirical question and here today one can use available data from a variety of judicial systems around the world. For example over the death penalty, we know that this is correlated with higher murder rates, and one can posit a plausible theoretical explanation as for why this is. This is over the implications of the state endorsnig the death penalty in response to murder. (In many other times and still in places today, state sanctioned killing was for a far lesser crime than murder, these are undeniably dis-proportionate and condemnable). Now capital punishment as a deterrent only works if makes people consider killing is not an option - due to the severity of the punishment - as opposed to reading that the state endorses killing as an option. Arguably it seems to be the later not the former lesson that is drawn in those societies with death penalties. So being agnostic on the justification for a death penalty, the empirical data to date indicate that this is not an effective deterrent. In addition it is very dubious to use this as a basis for retribution - which only encourages that same false conclusion as to what society endorses - retributive death.
The above point was illustrative and not conclusive. Each penalty needs to be empirically examined on its own merits in terms of deterrence. What is desired is a just law system that will coherently and consistently reinforce the underlying ethical values and not the specific values of that society which might have non-empirically based views on retribution and deterrence.
Assuming that the state has established guilt by a fair and just process then imprisonment is one means to protect society from offenders. The deterrence/social reinforcement has failed - otherwise they would not have committed the crime but this still leaves the rehabilitation option. Can they be rehabilitated? Whether current and past rehabilitative methods can work is again an empirical question, we have plenty of data to work on today but this outside the scope of the question here, save they methods would be reflective of and consistent with the means to generate ethical conduct via social forces. As to what the specific and best techniques are to do this again one can survey the present and past solutions and perform some similar, or better, analysis to what was cursorily examined above with respect to the death penalty as a deterrence.
If the person fails to be rehabilitated and a best effort was made to achieve this, then if there is clear likelihood of re-offending then the prison service serves to protect everyone else. Different forms of rehabilitation should be applied in a parallel too.
Finally the proportionality question can be answered (sort of). In one sense this could only apply to a kidnapper, if they have kidnapped someone for x days do they go in for some punitive multiple of the period of time they imprisoned each person. This hardly makes sense, it might mean encouraging people kidnap someone for a short time, knowing there is not much criminal cost - time inside - to doing so. The proportionality issue is better related to the reinforcement of ethical values, and protective and rehabilitative justice. Maybe no simple formula results but these three are the empirical basis to justify the use of harm to prevent harm.