The above site tells it better than I can.
You raise some good points. For people on the outside, and people who aren’t sociopaths, beating somebody up gets the message across just fine. Prisons are different. Not all prisoners need to be incurably evil - just a few prisoner are, and they are allowed the power to turn the place into their own little torture pit.
For one thing, there is a very different definition of homosexuality in the joint. The perpetrator of the sex crime is not considered homosexual. It seems that the aforementioned incurably evil criminals (and I do believe that - there is never a justification for rape) need someone to dominate sexually, just beating on each other isn’t enough. Outside of prison, they may be sex criminals, or they may dominate women in a (theoretically) consensual manner. http://www.igc.apc.org/spr/docs/prison-sex-lecture.html is the detailed lecture on this matter.
I’ve been interested in this for a while as a human rights matter. (I started by happening upon the matter of female genital mutilation in East Africa, a human rights problem compared to official connivance in prison rape its scale and severity.)
Could we eliminate prison rape? As usual, no. Could we reduce it? Yes. It is a moral imperative? Yes. Does this mean the average voter is going to start demanding change? No, just the ones whose kids get brutalized and psychologically damaged for life cause they got caught with a joint and had bad luck in a cellmate.
America: Wake up and do something about what is happening in your prisons
Nothing I write about any person or group should be applied to a larger group.