The U.S. Supreme Court on Monday ruled that church-affiliated hospital systems do not have to comply with a federal law governing employee pensions, overturning lower court decisions that could have cost the hospitals billions of dollars.

The court ruled 8-0 that church-affiliated organizations are exempt from the Employee Retirement Income Security Act, a 1974 law that forces private employers to follow rules aimed at protecting pension plan participants.

The ruling was a victory for New Jersey-based Saint Peter’s Healthcare System, Illinois-based Advocate Health Care Network and California-based Dignity Health, which had faced separate employee lawsuits accusing them of wrongly claiming a religious exemption under ERISA.

Federal agencies had long interpreted the law as exempting not just church plans but also those of church-affiliated organizations.

The employees challenged that view, in effect accusing the hospital systems of being big businesses posing as church organizations in order to avoid minimum funding and reporting requirements under ERISA.

The three hospital systems maintained that their religious affiliation made them exempt from ERISA. St. Peters is affiliated with the Roman Catholic Church. Dignity operates both Catholic and non-Catholic hospitals. Advocate is affiliated with the United Church of Christ and the Evangelical Lutheran Church in America.

Writing for the court, Justice Elena Kagan said the law’s religious exemption applies to plans whether they were established by churches themselves or organizations affiliated with the churches.

Justice Sonia Sotomayor agreed with the ruling based on the text of the law. But, in a separate opinion, she wrote that she was “troubled” with the outcome, noting that some church-affiliated organizations operate for-profit subsidiaries, earn billions of dollars in revenues and compete with companies that must comply with ERISA.

Sotomayor suggested that the U.S. Congress take action, adding that “scores of employees – who work for organizations that look and operate much like secular businesses – potentially might be denied ERISA’s protections.”

Full story at The New York Times.