My two cents:
The point of a penitentiary was to encourage repentance. Punishment used to be (in the US in the 1800s) simple, death by hanging or lashes etc.... Two problems occurred. First, people turned the hanging into a circus. Second, a philosophical view arose that stated that humans were only animals and needed to be retrained. The combination of these factors led to our prison system.
Now, I don't think that their is a simple solution here. The fact is that execution is good in some situations. If someone committed a coldblooded murder and was clearly guilty, then I don't want to spend my tax dollars on stuffing them in a cell for decades. How does that improve them? I am not in favor of barbarism, but lets not be coddle those being executed either. They weren't coddling their victims.
But, if you read the OT, God commanded that an investigation be made. If no criminal could be found to be clearly guilty, then they closed the case. They didn't go on a witch hunt.
Might be a good thing to take some of these criminals of non-violent crimes and force them to work for the state to work for their own room and board. Teach them to work instead of crime and keep them out of trouble.
I can't see how a prison is generally useful. Steal? Force them to work till they pay it off. What they skipped town? When caught, the sentence would be increased.
Meh, just my ramblings, and not in a great order either. Sorry about that.