On Thursday, in a 9-0 decision, the Supreme Court unanimously ruled for religious freedom in favor of two courageous Philadelphia foster mothers, Sharonell Fulton and Toni Simms-Busch. Inspired by their belief in God, they have cared for over 40 of the city’s most vulnerable children for 25 years.

» READ MORE: My faith led me to foster more than 40 kids | Opinion

The court ruled that Philadelphia violated the Free Exercise Clause of the First Amendment when it decided to terminate the city’s contract with Catholic Social Services (CSS) — the agency that Fulton and Simms-Busch worked with — because of the Catholic Church’s belief that every child deserves both a mother and a father.

The court’s unanimous decision is a win for religious freedom. It protects pluralism. It also means more children will be able to grow up with the nurture and love of moms and dads rather than in institutional care.

The implications of the case go beyond both Philadelphia and foster care. As Becket Fund attorney Lori Windham asked the court, “Does the Free Exercise Clause shrink every time the government expands its reach and begins to regulate work that has historically and traditionally been done by religious groups?”

The Catholic Church’s service to vulnerable children dates back more than 100 years, and the city has been a relative latecomer to foster care. Justice Amy Coney Barrett noted the clear consequences of government expansion by asking if increased state control over health care would also mean that Catholic hospitals must start performing abortions.

Fortunately, the Supreme Court ruled that Philadelphia burdened CSS’s religious exercise by conditioning its ability to serve on certifying same-sex couples as foster parents in violation of its religious beliefs. The city argued that it would be able to provide more foster families for the 250 children on the waiting list by terminating its contract with CSS, although not a single same-sex couple ever applied to be certified by CSS.

» READ MORE: The Supreme Court ruled against Philly in its fight with a Catholic foster group but may not have ended the dispute

Additionally, the agency referred same-sex couples to the 29 other agencies in the city that could match them with foster children. Noting the flaw in the city’s argument, Chief Justice John Roberts observed, “If anything, including CSS in the program seems likely to increase, not reduce, the number of available foster parents.”

Fulton reinforces the statement made by Justice Anthony M. Kennedy in the decision to redefine marriage where he underscored a positive view of religious motivations in the public square. In Obergefell v. Hodges, he wrote that the belief that marriage is between one man and one woman is based upon “decent and honorable” premises. He added: “The First Amendment ensures that religious organizations ... are given proper protection as they seek to teach the principles that are ... so central to their lives and faiths, and to their ... aspirations to continue the family structure they have long revered.”

In conflicts over the nature of marriage, the court’s decision clarified that federal, state, and city governments should not make zero-sum policies that disfavor belief in traditional marriage. The Constitution’s protection of religion must be heeded; the government does not have carte blanche to discriminate against a religious organization that doesn’t share its views.

Philadelphia made exceptions to its nondiscrimination policy for some actors in some circumstances (like race and disability), but not for Catholic Charities. Comments by city officials that “it’s not 100 years ago” and that Pope Francis should come and shape up the beliefs of CSS ran afoul of the admonition from Justice Kennedy in Obergefell.

Religious actors shouldn’t be forced to leave their beliefs at the door to serve in the public square. By upholding the Constitution, the court made a commonsense ruling that is a win for religious believers and all those whom they serve.

Emilie Kao is the director of the DeVos Center for Religion and Civil Society at the Heritage Foundation.