A provision that would have punished states for protecting LGBTQ adoptive and foster parents has failed in the House.

In July, Republicans on the House Appropriations Committee attached the Aderholt amendment, which would have banned states from enforcing anti-discrimination laws if they conflicted with an adoption agency’s religious beliefs, to a funding bill for the Departments of Labor, Health and Human Services, and Education.

Yesterday, though, the Aderholt amendment was dropped in negotiations between the House and the Senate, and the House passed the budget measure without it. The amendment faced strong opposition from Senate Democrats.

Representative Rosa DeLauro (D-CT) said, “I was proud to fight to ensure that the Aderholt amendment — which would have inserted bigotry and discrimination into our foster care and adoption systems — was removed from this year’s Labor, Health and Human Services, and Education funding bill.”

“Children deserve to live in safe, happy, and healthy permanent homes, and their best interests should always be placed first,” she added. “No qualified adoptive and foster care parent should be discriminated against, period.”

Related: Republicans vote to make it legal nationwide to ban gays & lesbians from adopting

The Aderhold amendment would have cut adoption funding for states by 15% if they did not allow adoption agencies to claim religious exemptions to state law, and it would have banned the federal government from passing similar measures.

“The Aderholt amendment had broken the cardinal rule of child welfare — that the needs of children should come first,” said Denise Brogan-Kator of the Family Equality Council.

Because of a lack of acceptance in their families of origin and at school, LGBTQ youth are over-represented in the foster care system, where they are twice as likely as straight youth to be removed or run away from a foster home.

LGBTQ parents are also more likely than straight parents to want to adopt. According to Census Bureau statistics, same-sex couples with children were about four times more likely to have adopted.

“Congress should be focusing on ways to help children in the child welfare system find homes rather than creating needless obstacles for prospective parents, effectively shrinking the pool of qualified folks who want to provide children with a loving home,” said HRC’s David Stacy.

Ten states currently allow state-licensed adoption agencies to refuse to serve LGBTQ families.

Donald Trump voiced opposition to the spending measure because it didn’t include funding for a border wall with Mexico, but Speaker Paul Ryan (R-WI) said that he expects Trump to sign it. The Department of Labor’s budget is being cut in the bill.