Gays are already in the military. Better to let them serve openly so one knows where they are - in the shower, sleeping next to you, etc.
They will probably stay in the closet anyway rather than face the scrutiny of their fellow servicemen.
I’m willing to bet that not many will openly admit they are gay.