Which is why "I support the continuation of DADT. It has worked well for two decades" would have been the best and most straightforward thing for Santorum (or any other candidate) to say.
Any person subject to this chapter [of the UCMJ] who engages in unnatural carnal copulation with another person of the same or opposite sex or with an animal is guilty of sodomy, Article 125 of the UCMJ states. Any person found guilty of sodomy shall be punished as a court-martial may direct.
There is also the point of "good order and discipline". Anything that interferes with that is also subject to court martial.