The U.S. Supreme Court on Thursday denied Philadelphia-based Catholic Social Services' petition to have its foster care contract with the city reinstated.

The court denied injunctive relief to the agency, which appealed a lower-court ruling that the city was within its rights when it terminated the organization's contract after discovering CSS would not work with same-sex couples.

Justices Clarence Thomas, Samuel A. Alito Jr., and Neil Gorsuch dissented. The case, which is under appeal, now returns to federal court.

"We hoped for a different decision today, but we are encouraged that three justices agreed that we had an 'indisputably clear right to relief' in order to help foster parents to continue serving children in need," said Lori Windham, an attorney for CSS and senior counsel at Becket. "We look forward to pressing these parents' case at the Third Circuit Court of Appeals in Philadelphia next month."

She said she expects oral arguments at the appellate court to take place in October or November.

The Department of Human Services had a legitimate interest in ensuring "that the pool of foster parents and resource caregivers is as diverse and broad as the children in need of foster parents," Tucker wrote.

Attorneys for the Catholic agency argued that requiring the organization to abandon its religious beliefs in order to care for kids infringed on its rights, and that the suspension put children in need of good homes at risk. Staff from CSS testified in federal court that the organization had about 30 certified homes going unused.

Following the ruling last month, Windham said the city "put politics above the children, and today the court allowed the city's discriminatory actions to continue."

Philadelphia DHS contracts with 29 foster care agencies to certify families and homes for the roughly 6,000 children in its care.

City spokeswoman Deana Gamble said the city was "thankful for the Court's careful consideration and pleased with the order we received earlier today."