The city of Philadelphia was within its rights to terminate its contract with a Catholic foster care agency over the agency’s refusal to work with same-sex couples, a federal appeals court has ruled.

Judge Thomas Ambro Judge Thomas Ambro.

On Monday, the U.S. Court of Appeals for the Third Circuit upheld a ruling that Catholic Social Services’ rights to First Amendment religious liberty were not infringed by the city’s requirement that its contractors adhere to a nondiscrimination policy.

Third Circuit Judge Thomas Ambro wrote in the court’s opinion that the city was on firm legal ground in enforcing its policy—though the case is not over.

“The First Amendment does not prohibit government regulation of religiously motivated conduct so long as that regulation is not a veiled attempt to suppress disfavored religious beliefs,” Ambro said. “And while CSS may assert that the city’s actions were not driven by a sincere commitment to equality but rather by anti-religious and anti-Catholic bias (and is of course able to introduce additional evidence as this case proceeds), the current record does not show religious persecution or bias. Instead it shows so far the city’s good faith in its effort to enforce its laws against discrimination.”

The Becket Fund for Religious Liberty, which furnished CSS with legal representation, vowed to continue the legal battle.

“This ruling is devastating to the hundreds of foster children who have been waiting for a family and to the dozens of parents working with Catholic Social Services who have been waiting to foster a child,” said Lori Windham, senior counsel at Becket. “We’re disappointed that the court decided to let the city place politics above the needs of kids and the rights of parents, but we will continue this fight.”

In a statement Monday, Philadelphia Mayor Jim Kenney lauded the court’s decision.

I am grateful for the court’s careful analysis of the case and its thoughtful decision. Our policy ensures that same-sex couples do not face discrimination as they seek to offer loving homes to Philadelphia children in need of foster care,” Kenney said. “At the same time, the policy safeguards religious liberties. We are proud that Philadelphia is a welcoming, inclusive city that values the diversity of its residents. This policy is the embodiment of those values, and we are pleased that the court has now upheld it.”

City Solicitor Marcel Pratt echoed Kenney’s praise of the ruling and added that the city’s nondiscrimination policies are neutral and apply to any organization, religious or secular.

“Today’s victory affirms the city’s approach to enforcing its longstanding Fair Practices Ordinance and nondiscrimination policies, protecting city residents from discrimination in its many forms,” Pratt said.