
Ethics In The Real World is good, too: https://www.goodreads.com/book/show/30272030-ethics-in-the-r...
In the past: societal self-defence.
Older prisons were not as secure, and so the risk of dangerous people escaping was high(er). If they got out they could do more harm to innocent people. This is less of an issue in modern developed countries which have pretty secure buildings now, especially for those classified as the most dangerous.
This may be less true in other countries where prison you may hear about prison breaks, with or without external help:
* https://en.wikipedia.org/wiki/Ghazni_prison_escape
* https://globalnews.ca/news/7740153/nigerian-inmates-freed-at...
If you think there's little/no chance of reform, then keeping someone around that will likely strike again is asking for trouble.
See also David Oderberg's book Applied Ethics.
