Sharonell Fulton listened patiently this month as a panel of judges at Philadelphia’s federal courthouse discussed whether she would ever have the chance to welcome another foster child into her home. For 26 years, Fulton has served as foster parent to more than 40 children. Her kids — some of whom she eventually adopted — call her “Meme.” But now Philadelphia officials have cast a pall over her continued role as a foster mother.

Meme is a foster mother thanks to the city’s Catholic Social Services agency. For more than a century, the Catholic Church has found loving foster homes for needy kids in Philadelphia. When Philadelphia assumed exclusive control over foster care 50 years ago, CSS, which is part of the archdiocese, and other private agencies partnered with the city’s foster care program.

Since then, CSS has certified and supported thousands of foster parents, who have opened their homes to tens of thousands of children. The archdiocese considers CSS’ work part of its religious ministry, just as many of the CSS-certified foster parents, “Meme” among them, see fostering children as an expression of their Catholic faith.

But this fruitful partnership between government and church abruptly ended in March, when the city froze CSS’ intake of foster children. The reasoning: the agency’s refusal to endorse same-sex couples as foster parents, because this would violate Catholic teaching on marriage and the family.

Since then, the City of Brotherly Love has waged a brutal campaign against CSS. Department of Human Services Commissioner Cynthia Figueroa told CSS leaders that they should follow “the teachings of Pope Francis,” wrongly assuming the Argentine pontiff endorses same-sex marriage.

Mayor Jim Kenney, meanwhile, triggered a human-rights investigation of the agency. “Times have changed,” Figueroa told a CSS official this year.

CSS offered to refer all same-sex couples expressing interest in fostering children to any of the 29 other foster agencies in Philadelphia. The city rejected that proposal. Enforcing ideological conformity was more important than respecting an institution’s long-standing religious beliefs or helping the city’s needy children.

It’s worth noting that shortly before the city severed its relationship with CSS, it made an urgent call for an additional 300 foster families to meet the growing need. In Philadelphia and across the country, the opioid crisis is swelling the ranks of children in our foster care system.

Many Catholic foster care and adoption agencies across the country have quietly closed their doors rather than abandon Rome’s teaching.

In August, Catholic Charities of Buffalo ended its foster care and adoption services after nearly 95 years. The agency cited its inability to comply with New York state rules requiring contracting agencies to allow same sex couples to foster and adopt.

CSS and the Archdiocese of Philadelphia, however, aren’t going down without a fight.

Meme Fulton is one of three CSS-certified foster parents who have joined a lawsuit challenging the new policy. They are committed to the children in need of foster care, but they’re unwilling to trample their faith and their constitutional rights.

They also believe that freedom of religion in the United States means more than worshipping privately in the catacombs. It should mean, among other things, joining others to make a difference in the lives of all suffering children.

At oral argument, an American Civil Liberties Union lawyer representing same-sex marriage advocates joined the city’s lawyer at the opposing counsel table. The city and ACLU framed CSS’ religious objections as discrimination and a form of stigma against gay youth.

They argued that CSS must either opt in to ideological conformity or opt out of the foster care business entirely. One of the judges aptly called that an all-or-nothing “Hobson’s choice.”

CSS and foster mothers like Meme Fulton deserve better. And so do Philadelphia’s needy children. Tellingly, Meme didn’t linger after oral argument had ended. She had to leave to pick up one of her — one of Philadelphia’s — foster kids.

Andrea Picciotti-Bayer is legal adviser for the Catholic Association Foundation.