View Photo Gallery: Virginia’s ‘conscience clause’.

A flurry of Democratic amendments failed Wednesday to stop a bill in the Virginia Senate that would allow private, state-funded adoption agencies to turn away parents based on sexual orientation or religious beliefs.

The measure cleared a preliminary vote after Democrats offered 18 floor amendments meant to change a bill that they said was intended to make it harder for gay people to adopt in Virginia. A final vote is expected Thursday.

Republicans supporting the “conscience clause” said it would protect the religious freedom of faith-based adoption and foster-care agencies, freeing them from having to place children with parents they deem unfit because of their religious views or sexual orientation.

Sen. Jeffrey L. McWaters (R-Virginia Beach), the bill’s patron, said it would be unfair to cut state funding from an organization for operating in accordance with its religious beliefs.

“I don’t know anybody who thinks that’s not discrimination,” said McWaters, who noted that the bill does not prevent agencies from placing children with gay parents if they choose to do so.

Sen. Mark Herring (D-Loudoun) proposed an amendment that would have made the “conscience clause” applicable only to private agencies that do not receive state funding.

“If you’re going to contract with the state or a locality, you should do that in a non-discriminatory manner,” he said.

That amendment failed on a 17-22 vote, with two conservative Democrats, Sen. Charles J. Colgan of Prince William and Sen. Phillip P. Puckett of Russell, joining Republicans. One Democrat, Sen. Mamie E. Locke (D-Hampton), was absent.

Sen. Adam P. Ebbin (D-Alexandria) proposed an amendment that would have required that gay children in foster care not be placed with parents who believe that homosexuality “is a behavior rather than an in-born, immutable characteristic.” It also would have required that the child not be subjected to “reparative or conversion therapy” meant to “cure” their homosexuality.

That amendment failed on 16-23 vote, with Colgan, Puckett and Sen. Chap Petersen (D-Fairfax City) joining the Republican opposition.

The House voted overwhelmingly for its version of the bill last week. A final vote is expected in the Senate on Thursday. Gov. Robert F. McDonnell (R), who has often said that faith-based organizations should be free to set their own policies, is expected to sign the legislation.