On Thursday, Gov. Greg Abbott signed into law a bill that allows adoption or foster care agencies to refuse to place children with certain prospective parents, including same-sex couples, under the guise of “religious freedom.”

Under the new law, any agency — or representative of an agency, individually — could register an objection to prospective parents, based on their sexual orientation or gender identity. But the bill would extend that religious objection to those who take issue with a prospective parent based on several other characteristics — among them age, marital status, disability, or religion.

Abbott’s decision to sign the bill into law makes Texas the sixth state in the nation to pass a “conscience clause” exemption allowing such discrimination. Other states with similar prohibitions on prospective adoptive or foster parents include Alabama, Michigan, South Dakota, North Dakota, and Virginia.

Equality Texas registered its fierce objection to the bill, writing in a statement: “The only consideration for a child welfare agency, organization, its employees, and foster parents should always be the best interests of the child — not advancing the interests or beliefs of a state contractor. It is our continued fear that implementation of this legislation could jeopardize the health and well-being of children in state care.”

Other child welfare advocates say the bill could put children in the state’s foster care system at greater risk by denying them the chance for loving homes based on a personal dislike of prospective parents. Writing for The Huffington Post, former foster child Kristopher Sharp recounts how he experienced harassment and abuse a the hands of a caregiver due to his perceived sexual orientation. After aging out of the foster care system, he ended up homeless on the streets of Houston, having to resort to survival sex for food, money, or a place to stay.

“Children need families, not facilities. At best, HB 3859 creates an atmosphere of confusion and discouragement for families who want to foster or adopt in a state that desperately needs more families to do so,” Sharp writes. “At worst, it will rob children of their livelihoods by unduly denying LGBT, single, or non-Christian parents opportunities to save children from the cycle of abuse and neglect they will almost certainly encounter growing up in the Texas foster care system.”

“After a legislative session full of attacks on LGBTQ Texans, Gov. Abbott has codified anti-LGBTQ discrimination into law by signing HB 3859,” Marty Rouse, national field director for the Human Rights Campaign, said in a statement. “This ‘Slate of Hate’ that the Texas legislature has made a priority harms LGBTQ Texans. This law will now prioritize discrimination over the best interests of children looking for a loving, stable home.”

Sarah Kate Ellis, the president and CEO of GLAAD, also slammed Texas lawmaker for “us[ing] religion as a weapon to pass a bill that not only harms qualified candidates who want to start families, but children.”

“This law was never about the best interests of Texans or of children, but about forwarding a political agenda to codify the permission to discriminate against LGBTQ Texans into state law,” Ellisa said in a statement. “Discrimination has won in Texas, and it saddens me that a child can now be denied the chance to live with a deserving family simply because they are LGBTQ.”