The suit challenges the U.S. Defense of Marriage Act. The bill, adopted in 1996, among other things denies federal tax benefits for state insurance plans that cover gay spouses.
U.S. District Judge Claudia Wilken refused Tuesday to dismiss the suit, the San Francisco Chronicle reported. She suggested she might reverse at least some of the Defense of Marriage Act.
President Barack Obama says he does not support the act but his administration is defending it in court.
Wilken said she did not believe the law was necessary to protect the institution of marriage and she believes its supporters were motivated by "moral rejection of homosexuality." She said the law denied states "the power to allow same-sex civil marriages that will be recognized under federal law."
A federal judge in Massachusetts has already ruled the Defense of Marriage Act is unconstitutional.
N.J. man wakes up from 10-hour sleep with knife in back
Police: Sword-wielding man demanded free tacos