Massachusetts became the first state to challenge federal laws that deny benefits to same-sex couples.