I don't believe the current system punishes offenders effectively or rehabilitates them. It's not great at segregating dangerous people either, as people are released when they've "paid their debt to society" rather than when they stop presenting a threat.
I'd prefer it if prisons were more like the prison farms in Scandinavia, especially for young non-violent criminals. They need to learn to produce things or render services that other prisoners will want. They should be able to build their own houses. They should have to learn how to work and freely trade with others BEFORE they are released.
Some criminals are a persistent threat to the population and must be tightly controlled. People who've murdered multiple people, for example. And some should never be released.
https://www.theatlantic.com/international/archive/2013/09/wh...
Anyway, a complicated topic for sure.