Gov. Mary Fallin of Oklahoma signed a bill on Friday that gay rights groups said would allow private adoption agencies to discriminate against L.G.B.T. couples on religious grounds when placing children.

The law would allow the agencies to choose not to place children in certain homes if it “would violate the agency’s written religious or moral convictions or policies.”

Critics of the law, which also applies to private agencies working in foster care, said it was unconstitutional and harmful to children. Supporters said it would ultimately help children by protecting the agencies that work to place them.

Ms. Fallin, a Republican, said in a statement on Friday that the law did not ban same-sex adoption or foster care in Oklahoma. “Instead, the bill will help continue Oklahoma’s successful placement of children with a broad array of loving families and basically maintain the status quo by setting forth in statute practices which have successfully worked for the best interest of Oklahoma children,” she said.