Gene Balas and Carlos Morales were facing health problems and crushing financial pressures plaguing many U.S. households when they decided to file bankruptcy as a married couple.
The Obama administration said they couldn't, citing the Defense of Marriage Act, which prohibits federal recognition of same-sex marriages.
On Monday, 20 of 24 judges sitting on the country's largest consumer bankruptcy court sided with the gay couple. In doing so, the court took the extraordinary step of declaring the Defense of Marriage Act unconstitutional.
The ruling is the first such attack of the Defense of Marriage Act in bankruptcy court, and it adds to the building pressure on the Obama administration to make good on a February pledge to stop defending the law in court.
Balas and Morales were among the 18,000 Californian same-sex couples who wed Aug. 30, 2008, during the brief period when gay marriages were legal in the state.
"It is hurtful to hear my own government say that my marriage is not valid for purposes of federal law," Balas said in a court filing.