Nevertheless, the Eighth Amendment does not require the separate placement of inmates based on sex. Galvan v. Carothers, 855 F.Supp. 285 (D. Alaska 1994) (The placement of a female inmate in an all-male prison wing did not constitute cruel and unusual punishment.); Dimarco v. Wyoming Department of Corrections, 300 F.Supp.2d 1183, 1192-1194 (D. Wyo. 2004) (The placement of an intersexual inmate, who was of alleged female gender but was anatomically situated as a male due to the presence of a penis, in segregated confinement for a period of 438 days, with concomitant severely limited privileges, solely because of the condition and status of ambiguous gender was not a violation of the Eighth Amendment prohibition against cruel and unusual punishment where the safety of the inmate and other inmates was secured by placing the inmate in administrative segregation, and the inmate was provided the basic necessities of food, shelter, clothing and medical treatment.); Lucrecia v. Samples, 1995 WL 630016 (N.D. Cal. 1995) (The transfer of a transsexual inmate to an all-male facility and her housing in an all-male cell did not violate the due process clause where the inmate failed to demonstrate the infringement of a liberty interest.).Source
From Breaking Out of the Prison Hierarchy: Transgender Prisoners, Rape, and The Eighth Amendment
On December 17, 2002, Kelly McAllister filed a claim against Sacramento County, its district attorney, and the sheriff’s department, alleging threats and slurs based on her transgender status, battery, and an assault that culminated in rape.Note that they don't have to be convicted - just arrested. And the alleged crime need not be serious - being too near a disturbance for example, or asking why you're being detained. You don't have to be actually guilty of any crime at all, it does you no good if the judge dismisses all charges as ridiculous if you've been pack-raped and infected with HiV. Or murdered in jail.
McAllister is a five-foot seven-inch, 135-pound pre-operative transsexual in her mid-thirties, who has lived as a woman for several years.
She was arrested in connection with a reported public disturbance.
After McAllister’s court appearance, she was placed in a cell with a larger male in-mate who brutally raped her.
Her attorney claims that the sheriff’s department knew of McAllister’s transgender status,but still placed her in a cell with a man.
McAllister’s ordeal typifies the risk faced by male-to-female (MTF) transgender persons incarcerated in jails and prisons across the country.
I know one trans woman who was arrested on suspicion of being an "English Spy" in Orange County, California, due to her accent. Fortunately the desk sergeant dealt with the matter before she was put in jail awaiting trial for it. Not all police are quite so thick, nor quite so bigoted.