WHAT!
> Rehabilitation sounds societally useful, but the failures have been overwhelming. Justice? Deterrence?
WHAT! Mind sharing some sources?
IMHO you have it completely backwards.
I can point to plenty of European countries (Norway, Germany, Netherlands, etc.) that focus on rehabilitation, not punishment.
Their recidivism and overall crime-rates rates are significantly lower than in the US and their prisons don't look like 3rd world shitholes.
They blow the US out of the water on every metric. If anything has failed (and spectacularly so), it's the idea that focusing your prison system on punishment works.
I can't fathom what gave you a different idea.