I don't even get what the reasoning for not having gays in the military is. That they'll be too busy making out to fight? Nonsense! The Spartans (iirc) encouraged homosexual relationships because you're much more likely to fight harder to protect your lover who is fighting right beside you.
There probably has to be some level of cohesion (keeping it together in combat - when you're under fire, you don't want your mates to wet their pants and run away), but I would assume that's established through drill and general camaraderie, not through romantic or sexual entanglement.
You're right. Fun fact though, there's a certain percentage of people who have to pack extra pants for a patrol. And nobody cares as long as they keep fighting.
There is some merit to that, but not quite in the way you may believe. Their "boot camp" (that didn't actually teach much in the way of combat, just enforced the Spartiates' social hierarchy) did involve the senior children abusing the younger ones (including sexually), creating a shared suffering and an incentive to become the fucker rather than the fucked.
You're more likely to fight harder alongside the people that made it through the same awful shit as you did.
If you'd like more info, there's a historian's blog I very much recommend who wrote a series on Sparta.
The reason was that it was seen as immoral, that straight soldiers would be too uncomfortable to trust them, and that the men would be too effeminate. It was also just an easy target.
The policy prohibited people who "demonstrate a propensity or intent to engage in homosexual acts" from serving in the armed forces of the United States, because their presence "would create an unacceptable risk to the high standards of morale, good order and discipline, and unit cohesion that are the essence of military capability".