A rabbi performs prayers over the couple religiously; it too is a contractual business contract the same as a civil union only under a chuppah (canopy) with vows that binds the couple by Jewish law. A marriage contract, ketubah, is signed before the ceremony. A man and a woman promise each other specific pledges that have been passed down for centuries, prescribed by Jewish law and Jewish tradition according to roles that the partners play in the marriage. These are sacred contractual promises.
So, in a sense, the rabbi is acting the same as the judge in contractual obligations by both the bride and the groom, also with rings and sacred vows. The irony is that the Jewish vows are to be bound by the law of Moses and the traditions of Israel. This is in no way any different than what the judge is doing according to civil law.