(CNN) -- The Department of Veterans Affairs cannot deny benefits to the wife of a lesbian military veteran, a U.S. district judge in California said in a ruling that in part cites this summer's Supreme Court invalidation of a key Defense of Marriage Act section.
The case involved former Army Sgt. Tracey Cooper-Harris, an Iraq and Afghanistan war veteran who sued the department last year after it denied dependency benefits to her wife -- whom she legally married in California -- because the federal government didn't recognize same-sex marriages.
While Cooper-Harris' case moved through the court system, the Supreme Court in June rejected the part of DOMA that denied federal benefits to same-sex partners, even those legally married. That left Title 38 of the U.S. Code, parts of which ban veterans' benefits for same-sex spouses.
In Thursday's ruling, Judge Consuelo B. Marshall, after noting the DOMA rejection, ruled that the government couldn't use Title 38 to deny benefits to Cooper-Harris' wife, Maggie Cooper.
Marshall cited defense experts who argued veterans' benefits are an essential promise to service members, helping retention and recruiting.
"The denial of benefits to spouses in same-sex marriages is not rationally related to any ... military purposes," the judge wrote. "Additionally, Title 38 is not rationally related to the military's commitment to caring for and providing for veteran families."