The judge rejected the argument that granting spousal benefits to gay couples would somehow undermine “the integrity of the institution of marriage.”