Andrew and Elad Dvash-Banks’ trip to the United States consulate in Toronto should’ve been a brief one. The married couple had twins while living in Canada, and Canadian law recognized the two men as their children’s sole parents. Andrew is an American citizen while Elad is Israeli, but under U.S. law, children born abroad with one American parent become citizens at birth. Both children should’ve promptly received citizenship.

Instead, a consular official demanded to know which spouse provided sperm for which child. The couple reluctantly disclosed that one child, Ethan, was conceived with Elad’s sperm, while the other, Aiden, was conceived with Andrew’s. The children shared an anonymous egg donor and were born via surrogacy just minutes apart. The official told Andrew and Elad that only Aiden could receive U.S. citizenship—and even then, only after a DNA test. Ethan, she asserted, did not qualify as an American.

This week, the legal advocacy group Immigration Equality filed suit against the U.S. government on behalf of the Dvash-Banks family as well as a binational lesbian couple facing the same roadblock. Immigration Equality argues the government’s policy violates the Dvash-Banks’ constitutional rights. It’s almost certainly correct.

The constitutional problems here are not subtle. In a trio of decisions, the Supreme Court has articulated clear protections for same-sex couples and their children. In accordance with due process and equal protection, the government may not “degrade or demean” gay couples on account of their orientation. It must recognize their marriages “on the same terms and conditions as opposite-sex couples.” It may not “stigmatize” these couples or infringe their right to “equal dignity.” And, critically, it must provide them with “the constellation of benefits” linked to marriage, including equal legal treatment of their children.

Now consider how the State Department’s policy undermines these protections. When a married, binational opposite-sex couple requests citizenship for children born abroad, the government gives it to them—as it must under federal law. The statute does not mention any necessary genetic link. Aaron C. Morris, executive director of Immigration Equality, told me he could not identify a single instance in which U.S. officials denied citizenship to the child of such parents because they used assisted reproductive technology. Indeed, Morris noted, heterosexual couples aren’t even asked how they conceived their children or whether the American parent has biological ties to the child.

Same-sex couples receive altogether different treatment. Under the current policy, the children of gay couples are considered to be born out of wedlock, even when their married parents’ names appear on their birth certificates. The law governing citizenship for children born abroad and out of wedlock applies tougher standards. In order to receive American citizenship, such a child must have a proven genetic link to their American parent. The State Department cited this statute to justify its decision to give one twin American citizenship while denying it to his brother.

There is a glaring constitutional flaw in this scheme: The government isn’t applying the same standards to same-sex and opposite-sex couples. It alleges that when same-sex couples use assisted reproductive technology, their children are “born out of wedlock.” But in the eyes of the law, that’s untrue. Canada considers Andrew and Elad Dvash-Banks to be the sole parents of Aiden and Ethan, and they were married at the time of the children’s birth. Moreover, the Supreme Court has ruled that states must list same-sex parents on their children’s birth certificates when they are conceived via ART. In no legal sense, then, were the Dvash-Banks’ children born “out of wedlock.”

By applying this misdescription to same-sex couples anyway, the State Department plainly runs afoul of the Constitution. The government’s current policy does not only “stigmatize” these couples or “demean” their relationship; it erases their marriage for the purposes of immigration law.

The State Department policy might pass constitutional muster if it applied equally to opposite-sex couples, and if that application were supported in the law. But, as Morris told me, there is no evidence that any heterosexual couple has ever been asked whether it conceived through ART when requesting citizenship for their child. Nor do these officials demand proof of genetic ties between the American parent and the child. Consular officials appear to ask these questions exclusively of same-sex couples. There’s a reason: Absolutely nothing in the text of the law governing binational married couples requires them to have a genetic link to their children in order to procure citizenship for them. The State Department fabricated this policy, then applied it exclusively to same-sex couples.

It is difficult to see how Immigration Equality could lose these cases given the current composition of the federal judiciary. But the lawsuits remain an important illustration of the hurdles many gay couples still face in their quest for equal treatment under U.S. law. Without robust judicial enforcement of their rights, LGBTQ families who suffer discrimination at the hands of the government would have little recourse. And Ethan Dvash-Banks could be denied American citizenship simply because his parents are gay.

Correction, Jan. 27, 2018: This article originally misidentified the location of Andrew and Elad Dvash-Banks’ meeting to obtain citizenship for their twins. They visited the U.S. consulate in Toronto, not the embassy. America’s embassy in Canada is in Ottawa, not Toronto.