The threat of rape in prison exists no matter who you are. That is a simple, horrible fact. But the nature of rapists and what makes them choose their victims has less to do with the victims themselves and is based more on the consequences of what they will do or more accurately the ability to minimize them. When there is a general attitude of "who cares" attached to a victim for whatever monstrously idiotic reason it will embolden a rapist even if there are other consequences because they view them as a formality, they feel an intangible vindication that encourages them to do it again.
To treat the transgendered in such a way is to encourage this mindset, to undermine the very purpose of prison by stripping away the inherent wrongness of a transgression against individuals or society by allowing criminals the chance to seize upon false vindication through their choice of victim. My view on the purpose of prison may be exceptionally harsh compared to most others: I believe prison is where you go to regain your rights as a human being and those who belong there are basically animals until they prove otherwise. But that view also means that I hold in the deepest contempt anyone who impedes the actual process of regaining human status undermining and invalidating the humanity of those who wish to rehabilitate and rejoin society. To be so flippant about in-prison victimization allows the animals to remain animals and those who would be human to be treated like the animals they're surrounded by. And to treat the humans as animals which is unacceptable in and of itself is worsened exponentially by attempting to justify that dehumanization not because of anything they've done but because of a disagreement on who they are.
Treat people as what they are. A transgendered woman is a woman regardless of the past or present state of their body. A transgendered woman in prison serving her sentence in good faith to regain her place in society is a human being. To deny a woman is a woman is to deny one of the things that makes her human, which impedes regaining her place in society and thus even if she shows every intention of acting like an animal she is and must always be treated as a woman. An animal who seizes upon the excuse to set upon them like a piece of meat left in the open because they perceive a blunting of response is nothing more than an animal - an animal that has attacked a human and proven that they are not rehabilitating and cannot go out among humans yet - regardless of their biological resemblance to a human. It is our character and self-realization that makes us what and who we are, not biology.