Certain rights and privileges in the military have always been curtailed.
It thus seems to me that an argument can be made that the courts do not have jurisdiction over rules regarding homosexuality.