Might be less about gender/sexuality*, and more about how the DoD handles anyone who is on longstanding-medications. To be medically fit for service, the DoD wants you to be able to be shipped anywhere in the world, overnight, with 6-12 months of whatever you may need. Including medications. (exceptions sometimes made for well-ranked individuals).
If it is implausible (because of expiry) or unfeasible (because of logistics - for example: meds that must be kept in the fridge) for a soldier to put those meds in a deployment bag, or if the medication requires monitoring (like any med that requires lab tests / blood work) and dosage adjustment, then that person is typically considered medically unfit and discharged.
*or, it might be.