Philadelphia's Department of Human Services was back in court Tuesday, defending its refusal to contract with a Catholic foster-care agency that won't work with LGBTQ parents. The city has said Catholic Social Services is in violation of its fair-practices ordinance, which prohibits city contractors from discriminating on the basis of sexual orientation.

A federal judge in July ruled in favor of the city, denying the provider's petition for its contract to be reinstated. Catholic Social Services argued that by its being sidelined, children in need of homes have been put at risk, and that forcing the agency to work with same-sex couples violated its religious freedom.

A federal appellate panel was to hear the case beginning at 2 p.m. The U.S. Supreme Court in September declined to get involved.

Similar cases have popped up around the nation this year following the legalization of same-sex marriage, prompting more same-sex couples to sign up to foster or adopt. In courtrooms across the country, religious-affiliated nonprofits find themselves in conflict with antidiscrimination ordinances.

‘Too gay to adopt’

In Texas earlier this year, a lesbian couple who wanted to foster refugee children were turned away by Catholic Charities of Fort Worth because they did not mirror "the Holy Family."

Fatma Marouf, 41, who heads the Immigrant Rights Clinic at Texas A&M University, sued the U.S. Department of Health and Human Services and the United States Conference of Catholic Bishops. Both fund Catholic Charities.

Her attorneys from Lambda Legal argue that federal taxpayer dollars are being used to fund an organization that discriminates against LGBTQ people. The United States has no federal law against discrimination based on sexual orientation, and the Trump administration in January created a Conscience and Religious Freedom Division, though the effect of that on policies or lawsuits remains to be seen.

At least 11 states, including Texas, allow religious organizations to decline service to a person if that person's beliefs conflict with the organizations' religious beliefs.

The case in Texas came up on the campaign trail this summer when U.S. Senate candidate Beto O'Rourke faulted the federal government's stance, lamenting that in Texas you can be "too gay to adopt," a child.

In South Carolina, a debate traditionally focused on faith-based agencies and same-sex couples instead involves a Protestant foster-care agency that wants to turn away Jewish parents.

That agency, Miracle Hill, came under fire this year for its policy to work only with Protestant families. South Carolina's Department of Social Services said the action violated federal and state religious discrimination laws and it gave the agency 30 days to comply. Miracle Hill has asked President Trump to allow the group to exempt parents of other religions.

In Michigan, the ACLU and with two same-sex couples have sued the state, saying its policy that allows child welfare providers to discriminate against same-sex couples violates the establishment clause. A federal judge in September ruled that the case should move forward. Michigan has had a law since 2015 that says child placement agencies can refuse services in situations that conflict with their religious beliefs.

Leslie Cooper, deputy director of ACLU's LGBT & HIV Project, has worked on the case in Michigan and in Philadelphia. She said religious protection laws are being created around the country to erase nondiscrimination protections. "Our opponents like to say faith-based agencies are going to have an issue surviving," she said. "The fact is, there are many agencies that are willing to accept all same-sex families, regardless of their beliefs. When they decide to contract with the state, they comply with professional child welfare standards, which provide that you accept all qualified families."

Catholic Social Services in Philadelphia has said it will be forced to shutter its foster-care division (the agency has other contracts with the city) if the city wins the case. Lori Windham, senior counsel at Becket, a law firm supporting religious-freedom cases, said 12 people will lose their jobs if the agency closes, and children who need homes will suffer. "Catholic has more than two dozen homes available for foster children, but the city won't let it fill those homes," said Windham, who represents the Catholic agency. "That number will continue to rise as long as the city's shutdown continues, and within months, Catholic will have no choice but to close its doors."