https://en.wikipedia.org/wiki/Prison_sexuality

"Prison sexuality for males has been studied since the 1930s. Research is lacking on consensual sex because most research done has focused on coercion. Sexual abuse is more common among male inmates. Men sexually abuse others to establish dominance, power and to maintain their masculinity. Men who are physically weaker will offer consensual sex in exchange for protection, security, goods or support.

Heterosexual men in prison view their homosexual acts as being "situation specific" and may not consider themselves bisexual. These men often describe how they imagine being with a woman while taking part in sexual activity with a male inmate. During masturbation, they picture past sexual experiences with women. They take part in homosexual activity due to having no “heterosexual outlets”"