Gay marriage is an immediate threat to themselves, and done on a public scale.
Because it’s a public operation, the govt has the authority to intervene.
In what way is it an immediate threat to themselves? What risks do they assume by going through a farce of a ceremony that they weren't already assuming before that?