These guys are so stupid. Marriage used to be a practical arrangement and union of families/clans and had nothing to do with religion/god. Getting god involved is a relatively new thing.
Actually in the US ALL marriages are civil contracts. The myth that only a Church can control & define marriage is promulgated by these religions themselves, to increase their power over society.
All a minister or rabbi can do is confirm that the conditions for a legal marriage have been met, and to sign a marriage license. A license that must be issued by the State or a County. The State can recognize a minister or rabbi to act with legal standing in this regard.
And note that many marriage ceremonies end with the formula: "By the power invested in me by the State of (Xxxxxx), I now pronounce you man and wife." It's not: "By the power invested in me by God..." or "By the power invested in me by the Baptist Church..." or any other religious entity. I now informally observe, however, that many churches have begun to omit those first words, and now simply say: "I now pronounce you man and wife."
A Church by itself, lacking that official license, cannot legally marry anyone. Any religious ceremony the Church includes as part of a ceremony prior to completing the license is purely at their option, and with agreement of the couple.
This is also why the argument that same-sex laws "compel" Churches to violate their beliefs is totally bogus, a false argument used to gain public and State support for their own influence over laws. Clergy already have the right to decline officiating at a marriage of which they do not approve. Catholic priests, for instance, will normally not marry a couple who are both not Catholics (it can be done with a special RCC dispensation). And I don't think you'll see too many rabbis routinely performing a Christian rite ceremony in a Church. The State does not penalize those denials.
But the State DOES perform civil marriages, which is what this judge has declined to do, an illegal refusal under law. Could a judge also say: "I dismiss this case of infanticide and spousal assault against this man, because my 'deeply held religious beliefs' hold that the Bible permits a father and husband to do what he likes with his family, even unto death." Would that also be permissible?