I think it's more that anything even remotely resembling a woman in male prison is gonna get raped. But they have protective units for that. Prison isn't fun for anyone, if you don't want to be in prison, try not committing crimes.
I don't really agree with the idea that rape is a natural or desirable feature of imprisonment. I think that we need to do whatever we can to minimize and eliminate sexual assault in prisons. It is utterly inhumane and disgusting to just shrug our collective shoulders and go "well, they shouldn't have committed crime." Rape is
never okay. Especially not in an institutional environment wherein the state is responsible for the well-being of the incarcerated.
Being in prison is the punishment these people have been given,
not being raped. Similar to how the state is responsible for providing food and medical care to prisoners (which is an area we desperately need improvement in as well!), the state is responsible for ensuring that inmates are not sexually assaulted while in custody.
No one deserves to be raped. No matter what they've done. Full stop.
I would also add that it's not an issue of "anything remotely resembling a woman," as men who "identify" as men and are masculine are also sexually assaulted in prison. Many times, the rapist is a guard or warden. This is not an issue that only effects effeminate men, and even if it were, that would not make it permissable.
Anyway, the desperate need of prison reform in the US aside, a trans-identified prisoner who has reported being sexually assaulted multiple times obviously
should be moved to a protective unit for his own safety. But that isn't a solid answer for all of the sexual assault that happens in prison.