Philadelphia can exclude a Catholic foster care agency from a program for placing children with foster families because it refuses to work with same-sex couples, a federal appeals court ruled on Monday.

In a 3-0 decision, the 3rd U.S. Circuit Court of Appeals said Catholic Social Services failed to show that the placement freeze amounted to religious persecution or bias, violating its First Amendment rights to free speech and religious freedom.

Circuit Judge Thomas Ambro said Philadelphia was trying merely to stop what it considered a “clear violation” of a city anti-discrimination law covering sexual orientation, making a preliminary injunction inappropriate.

“The question in our case is ... whether CSS was treated differently because of its religious beliefs,” Ambro wrote. “Based on the record before us, that question has a clear answer: no.”

Catholic Social Services is part of the Archdiocese of Philadelphia.

Lori Windham, a lawyer from the Becket nonprofit representing the agency, called the decision “devastating” to hundreds of foster children waiting for placements and parents waiting to foster a child. “We will continue this fight.”

Jim Kenney, Philadelphia’s mayor, welcomed the decision.

“Philadelphia is a welcoming, inclusive city that values the diversity of its residents,” Kenney said in a statement. “This policy is the embodiment of those values.”

The case reflects persistent tensions in the United States between advocates for religious groups seeking exemptions from anti-discrimination laws, and civil rights advocates who call exemptions a license to discriminate.

Ten U.S. states let state-licensed child welfare agencies refuse placements and services that conflict with their religious beliefs, according to the nonprofit Movement Advancement Project. (here)

The Philadelphia dispute arose in March 2018 when the city suspended referrals after a newspaper report about Catholic Social Services’ policy of turning away same-sex couples.

U.S. District Judge Petrese Tucker in Philadelphia refused last July to issue an injunction.

The next month, U.S. Supreme Court without explanation denied the agency’s request to intervene, after Catholic Social Services warned that a freeze threatened its closure.

Justices Clarence Thomas, Samuel Alito and Neil Gorsuch, all from the Court’s conservative wing, said they would have granted the agency’s request.

The agency drew support for Monday’s appeal from Texas and seven other Republican-led states, and from 42 Republican lawmakers including Senator Ted Cruz and House Minority Whip Steve Scalise.

Massachusetts and 16 other mostly Democratic-led states, as well as Washington, D.C., supported Philadelphia.

The case is Fulton v. Philadelphia et al, 3rd U.S. Circuit Court of Appeals, No. 18-2574.

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM