Religious liberty means different things to different people. To James Madison, it meant freedom from religious persecution—and, specifically, from taxes used to fund specific religious sects. To Thomas Jefferson, it meant freedom of worship, safeguarded by a strict separation of church and state. And to South Dakota Republican Gov. Dennis Daugaard, it means the freedom of state-funded agencies to refuse to let same-sex couples foster or adoption children.

On Friday evening, Daugaard signed SB 149 into law, granting publicly funded adoption agencies a license to discriminate. The law permits any “child-placement agency” in the state—including those that receive taxpayer money—to discriminate on the basis of “any sincerely-held religious belief or moral conviction.” Republican legislators designed the law to let these agencies turn away same-sex couples who hope to foster or adopt; its Senate sponsor, Republican Sen. Alan Solano, co-wrote the bill with Catholic Social Services, a vigorously anti-gay religious adoption agency that will not place children with same-sex couples. But the measure actually extends far beyond LGBTQ discrimination: It will also allow agencies to discriminate against single and divorced people, couples who engage in premarital sex, interfaith couples, and anyone else whose behavior or identity violates an agency’s “religious belief or moral conviction.”

More than 300 children are currently awaiting adoption in South Dakota, a number that SB 149 may well increase. Many of these children were removed from neglectful or abusive homes; SB 149 reduces the odds that they will find families to take them in. Adoption and foster care agencies may now turn away qualified individuals for reasons that are utterly immaterial to the wellbeing of children. The upshot of the bill is that more kids are likely to be left without homes and families.

And for what? Religious adoption agencies in South Dakota had no problem exercising their religion before Daugaard signed SB 149. Catholic foster care services were not subjected to daunting lawsuits alleging discrimination. This bill was motivated by nothing except a mean-spirited desire to prevent LGBTQ people from fostering and adopting kids. Same-sex couples may be heartbroken, but they’ll find another way to start families. And it will be the children who suffer the most, victims of yet another repugnant effort to dress up bigotry in the guise of religious freedom.