A federal judge in Michigan issued a ruling last week in favor of a religious organization that contracts with the state to provide adoption services but refuses to evaluate same-sex couples as candidates. The ruling raises concerns about the use of “religious freedom” claims by religious organizations to stymie anti-discrimination efforts.

Like many states, Michigan contracts with private child-placing agencies (“CPAs”) to evaluate prospective foster or adoptive parents. Before a family may adopt, a CPA must assess their home and submit a recommendation to the state. Such arrangements have created friction when religious CPAs that object to marriage between same-sex couples have been asked to assess their homes.

In 2015, Michigan enacted a law specifying that CPAs were not required to provide services that conflict with their religious beliefs. The American Civil Liberties Union challenged the application of this law on behalf of same-sex couples. Although the state initially defended it in court, Dana Nessel, then running to become attorney general of Michigan, announced that she believed the law was discriminatory. After she was elected, the state changed its position and agreed in a settlement to include and enforce non-discrimination provisions in all contracts for adoption services. This would prevent CPAs from refusing to perform a home assessment for a qualified same-sex couple.

Nessel was right, and the settlement served a commendable purpose. CPAs receive both state and federal funds. LGBTQ Americans are entitled to equal treatment and freedom from the indignity of being directed to a separate CPA based on their sexual orientation -- especially when the entities involved are funded by taxpayers.

Additionally, the Constitution’s church-state separation provisions require that any special accommodations for religious practices be narrowly drawn so that they do not harm or unreasonably interfere with the rights of others, like prospective LGBTQ parents in Michigan. And similar antidiscrimination efforts have been upheld by other courts: in Fulton v. City of Philadelphia, the 3rd U.S. Circuit Court of Appeals recently decided that an adoption agency’s religious views on marriage between same-sex couples did not entitle it to an exception from a non-discrimination law.

Nonetheless, in Buck v. Gordon, Michigan’s settlement was challenged by a religious CPA that objects to assessing LGBTQ couples. The CPA argued, in part, that application of the settlement would violate its free-exercise rights under the First Amendment. In a ruling last week, the U.S. District Court for the Western District of Michigan issued a temporary injunction against the settlement after finding that the CPA had demonstrated it was likely to succeed on this claim. This is concerning, as the organization should not prevail here.

The court reasoned that the state’s conduct should be reviewed under a heightened “strict scrutiny” standard, largely because it found that campaign statements by Nessel created “a strong inference that the State’s real target is the religious beliefs” of the CPA rather than discrimination against LGBTQ Americans.

Superficially, its logic echoes that of Masterpiece Cakeshop, when the Supreme Court held that statements by members of a civil-rights commission exhibited bias toward the religion of a baker who refused to bake wedding cakes for same-sex couples. But key differences distinguish Masterpiece from Buck.

Significantly, Nessel’s campaign statements were not aimed religion. She had, for example, described Michigan’s 2015 law as being motivated by “discriminatory animus” and advanced by proponents who “disliked gay people more than they cared about children.” These statements were critical of discrimination, and courts should not treat a commitment to combatting discrimination as evidence of anti-religious bias.

Moreover, in Masterpiece, the Supreme Court emphasized the fact that biased comments were made “by an adjudicatory body deciding a particular case,” which raised heightened concerns. Here, the comments at issue were made by a private citizen campaigning for office. The district court’s opinion cannot be reconciled with the Supreme Court’s Trump v. Hawaii decision, where the Court did not apply strict-scrutiny review to the Trump administration’s travel ban despite the animus against Muslims Trump had shown as a candidate on the campaign trail.

In any event, the terms of the settlement should survive even the strict review that the court applied. Laws that are tailored to serve a “compelling” government interest are constitutional even under strict-scrutiny review. Michigan has a compelling interest in preventing taxpayer-funded organizations from refusing to work with prospective parents based on their sexual orientation, regardless of whether that parent may be able to find another CPA that will work with them.

Civil-rights legislation aimed at this type of invidious discrimination has long been acknowledged by courts, including the Supreme Court in Masterpiece, as advancing compelling state interests. Similarly, nondiscrimination conditions on federal and state funding of child-welfare programs promote the best interests of children in governmental care and further the important interest of attracting a diverse pool of foster applicants.

While litigation will continue with a preliminary injunction in place, the court’s reasoning at this stage is disturbing. The principle of religious freedom is important, but it simply does not provide religious organizations that accept taxpayer funds with a license to discriminate.