The ruling is a victory for many who have fought to end discrimination against same-sex couples.