How do you cure homelessness? You provide homes.
How do you deal with mental and physical illness? You provide health care.
How do you give people are path forwards? You provide education.
All of these things are what our societies are for. To carry on about "law and order" and even the "rule of law" without also quoting the part about "promote the general welfare" is to completely miss the purpose.
edit: I may be guilty of not listening to what you're actually saying. If you're saying there is something in the core of people that is delighted by revenge, therefore the current system, I agree. If you are saying that justifies a focus on punishment, I disagree.
Justice is the sense that good action will be rewarded, and bad actions will come to a bad end. Not "I'm gonna kill anybody that crosses me!" They are very different, and its not useful discussing this if that is not clear.
Who know how many more criminals there might be, if punishment was off the table? Recidivism doesn't count that. So there's that social pressure too.
Its pretty easy to figure out 'why punishment', if you try.