The Trump administration’s attempt to deny citizenship to the children of binational same-sex couples suffered a setback on Thursday when a federal court ruled these children are American citizens. U.S. District Judge John F. Walter of California rejected the State Department’s startling assertion that a married gay couple’s son was born “out of wedlock” and thus is ineligible for citizenship. But his decision applies only to these plaintiffs—meaning Secretary of State Mike Pompeo may continue to enforce an anti-gay policy on other binational couples. Somehow, nearly two years after the U.S. Supreme Court guaranteed equal rights to same-sex parents, the U.S. government is still trying to discriminate against their children under immigration law.

Thursday’s decision in Dvash-Banks v. Pompeo revolves around a married couple, Andrew and Elad Dvash-Banks, and their sons, Ethan and Aiden. Andrew is an American citizen; Elad is Israeli; and the couple’s children were conceived through surrogacy and born in Canada. Under U.S. law, a child born abroad receives citizenship at birth if his parents are married and at least one is an American citizen. Ethan and Aiden’s birth certificates list Andrew and Elad as their parents. Because Andrew and Elad are married, and Andrew is an American citizen, both children would appear to have a right to U.S. citizenship.

As a matter of law, Ethan and Aiden were born to married parents.

The Trump administration disagreed. When Andrew and Elad visited the American Consulate in Toronto to apply for U.S. passports, they were rebuffed. A consular official demanded to know which father provided sperm for which child—a fact that the couple had planned to keep secret. She then said that only Andrew’s biological child would obtain citizenship, and then only after a DNA test confirmed their relationship. Aiden would not be allowed citizenship. That’s because, under current State Department guidelines, the children of same-sex couples who conceive through surrogacy are considered to be born “out of wedlock.” And federal law does not extend citizenship to children born abroad out of wedlock unless a biological parent is a U.S. citizen. Andrew and Elad filed suit on Aiden’s behalf.

There is an obvious flaw in the State Department’s rules: As a matter of law, Ethan and Aiden were born to married parents. It seems factually incorrect to claim they were born out of wedlock, unless the federal government rejects the legitimacy of their birth certificates and their parents’ marriage. And the Supreme Court has already held that the government must both respect same-sex marriages and grant equal rights to children of such marriages. So the State Department’s policy raises a serious constitutional question of unlawful discrimination against gay binational couples and their kids.

Perhaps recognizing this problem, the Department of Justice insisted that its hands were tied by the federal statute that governs citizenship of children born abroad. According to the DOJ, its cramped conception of wedlock arises not out of the State Department’s anti-gay animus, but from the law itself. Congress, the DOJ wrote, said that children are only “born in wedlock” if they have a biological relationship with both their married parents. Aiden was not “born in wedlock” under this cramped definition, so he may not become a citizen.

As Walter explained in his decision on Thursday, the fatal flaw in this argument is that it is simply untrue. There is no biological requirement in the federal statute that governs Aiden’s citizenship status. The law merely states that, to become a citizen, a child birthed abroad must be “born … of parents” who are married, and one of whom is an American citizen. Other provisions of the statute do expressly demand a biological link between parent and child—but this one does not. Indeed, the U.S. Court of Appeals for the 9th Circuit has already ruled that the law does not require a “blood relationship” between a child and his citizen parent, so long as both parents were married at birth. That holding resolves this case.

Having resolved the case on statutory grounds, Walter did not delve into the constitutional issues lying just beneath the surface. He granted the Dvash-Banks family’s request that the government recognize Aiden’s status as an American citizen. But he did not block the State Department’s policy, choosing a narrow remedy that helps only these plaintiffs. That means other couples fighting the policy—like two lesbian moms caught in an identical bind—will have to keep fighting.

What’s most remarkable about Walter’s ruling is how brief and straightforward it is. At first glance, this case might seem complex, sitting at the intersection of surrogacy and immigration law. But the reality is that the Dvash-Banks’ sexual orientation should not actually complicate matters at all. The 9th Circuit previously found that the “presumption of legitimacy” applies to opposite-sex couples here, even when there is evidence that one parent had no biological relation. Why shouldn’t that presumption apply equally to same-sex couples? The answer, according to Walter (and the Supreme Court), is that it must.

Understood properly, then, Dvash-Banks v. Pompeo is not a case on the margins of civil rights law. It reveals that the federal government is still attempting to treat the children of same-sex couples unequally, misreading statutes to deprive them of their rights. Binational heterosexual couples seeking citizenship for their children are never asked about their biological connections; the State Department policy targets gays alone. In 2017, the Supreme Court affirmed that same-sex couples must be given the “constellation of benefits” associated with marriage, including equal treatment of their children. Less than two years later, the Trump administration is working to undermine that guarantee—to prevent a toddler from acquiring the citizenship he is owed under law.