Look at it this way.
Let’s say that you have a group of women living in a barracks, sharing a common shower.
Lets say that the military assigns a man to live in that same barracks and share the same shower ( shower with them)
Your average person is going to think that that is objectionable. No one, for example, is going to want their daughter to live in such an environment.
Sure, the authorities will say that the man will make no advances, and if fully capable of controlling himself. And that would most likely be true. But, I think we can all truthfully say that the women in the barracks would have every right to feel uncomforable and object.
In addition, it would hardly help enlistment for women if they are told they might have to shower with a man, or get dressed\undressed in front of one on a regular basis.
Well, the same holds true for a homosexual male living in the barracks. Sure, he would most certainly controll himself, but the other men would have just as much right to feel uncomfortable with the situation as the hypothetical women would.
And it would have an equivelent effect on enlistment. How many men are going to sign up if the know they would have to share shower space with a gay man and could file no objection?