Do you have a source for this claim?
As I understand it, this is flatly untrue. Jails were, up until quite recently, designed to hold people awaiting trial, not as punishment.
My belief is that imprisonment for decades as punishment is a 20th century phenomenon.
The only book I've read on this specific matter is "Discipline and Punish: The Birth of the Prison" by Michel Foucault, but that was a decade ago; I'm not sure if the details are crisp in my mind.