It's not really a swing and a miss...
If you're a medical doctor, that title comes with a certain set of responsibilities to your patients and if adherence to one's religious beliefs are going to preclude them from providing comprehensive care, then their religious preferences need to take a back seat to them actually fulfilling their duties.
For your second part, I think you're confusing a few things...gay people don't have to take sex hormones, I think you're confusing them with trans-folks.
There are certain religious beliefs and convictions that, if the holder of them felt compelled to project those rules onto others, would prevent them from fulfilling the duties of being an M.D.
For instance, if a religious person chose to be very strict about the concept of not seeing a person of the other gender with certain body parts exposed, that could prevent someone from being an MD.
IE: a doctor in the hospital can't simply say "sorry, that women who was brought in, that was in a car crash, was wearing a short skirt and revealing top...looking at that might cause lust so I have to step away from the situation".
There are certain key roles within a society that just don't mix well with the idea of what I like to call "professional activism". For instance, I wouldn't want a cop arresting someone for drinking at age 24 on the grounds that "I don't care what the state says, I think the legal age should be 25!"
There's a reason why certain positions within our society require state licensing and certification (Medical Professionals being one of them)...being a doctor is different than working at Target.