Firstly having worked in prisons extensively OP you are very naive , it is not remotely the same. I think it is very hard for students (my nephew is back at university) but not every case is like the ones you describe.
You are catastrophising from some , so far you have not shown evidence of being true , cases across the board where these things are patently not happening in most places.
I'd be extremely surprised that they are locking in people with deactivated keycards. If they are, then absolutely that is horrific (and illegal).
For those comments about prisons , I don't understand why people make generalisations about things that have no idea about. Yes some people are on remand and haven't been convicted yet ...however do you really understand why people are remanded? It's not willy nilly there are reasons for it. However the same as others have said prisoner ethnicity is unfairly weighted because the courts and police are.
Finally , how we treat prisoners is less a reflection on them and more a reflection on how we choose to be as a society. Treating prisoners humanely is about us choosing to respect human life , to a point ( as in the difference between restricting freedom to not condoning an abusive system) I've been the victim of a horrific crime to a family member, I have also worked heavily within the system. None of it is simple ,none of it can be boiled down to a few generalised lines on a forum post. It requires extensive consideration of different circumstances.
If you choose to pick and choose how you treat human life , I'm afraid it says more about you than it does about them. Its not about them , it's about who we choose to be. No that's not easy , and I promise you I have stood in courts in the most horrific circumstances and I practise what I preach , as mind bendingly hard as it was.