>Can they really just do that, do they have standing?
SCOTUS can do whatever it wants. The only check/balance is for Congress to impeach the Justices.
However, what anyone will do with the ruling is another matter if the other parts of the government decide to ignore the decision.
What the military might do is likely the most important attribute to ponder.