Dear HN audience. For almost all of the topics discussed here, if you haven't already, please go read this book:
Michel Foucault, Discipline and Punish: The Birth of the Prison [1]
The seminal book on questions like: Where do prisons come from? Why did anyone ever think that they were a good idea? Do they work?
Highly recommended