A unanimous U.S. Supreme Court on Thursday ruled that Philadelphia violated the First Amendment when it declined to contract with a foster care agency refusing, for religious reasons, to certify same-sex couples as foster parents.

“[Catholic Social Services] seeks only an accommodation that will allow it to continue serving the children of Philadelphia in a manner consistent with its religious beliefs; it does not seek to impose those beliefs on anyone else,” Chief Justice John Roberts Jr. wrote for the court. “The refusal of Philadelphia to contract with CSS for the provision of foster care services unless it agrees to certify same-sex couples as foster parents cannot survive strict scrutiny, and violates the First Amendment.”