“punishment” doesn’t work (as in the huge re-offending rates for ex-prisoners), there’s little attempt to alter it. The judgements and convictions of courts are, anyway, usually based on a mish-mash of personal or legal opinion, public pressure, social isolation, revenge, and tradition – before any considerations of social rehabilitation.