There's a little bit of karmatic (?) justice here, but disgust for the man aside it's obviously not ok that rapes happen to anyone in prison.
(avatar by Thomas Nast)
Once you force someone into cells and you start controlling their life you are responsible for their well being. I don't care if it's hard to keep them safe. That is nothing but an excuse.