The U.S. Supreme Court on Monday took up an employee-retirement dispute that threatens to expose religious-affiliated, nonprofit health care systems to billions of dollars in retroactive penalties rooted in the protection of pensions.

Lisa Blatt of Arnold & Porter Kaye Scholer, representing the health systems, argued that three federal appellate courts were wrong to conclude that the hospital networks’ retirement plans were not entitled to an exemption from the federal Employee Retirement Income Security Act, or ERISA.

Related: Supreme Court hears religious health care system pension case

The employee-retirement law, protecting employee assets, sets minimum standards for most voluntarily established pension and health plans in private industry, including rules to ensure the accountability of plan fiduciaries. The plans for religious-affiliated health system have been exempted as “church plans” for three decades. Class actions on behalf of affected employees are challenging those claimed exemptions.

The justices consolidated three cases for argument on Monday: Advocate Health Care Network v. Stapleton; St. Peter’s Healthcare System v. Kaplan; and Dignity Health v. Rollins. Dignity Health is the fifth largest health system in the nation and the largest hospital provider in California. Advocate Health Care Network operates 12 Church of Christ and Lutheran affiliated hospitals in Illinois. St. Peter’s Health Care System is a Catholic ministry with a hospital in New Jersey.

The hospital systems say they have relied for more than 30 years on “private letter” rulings by the Internal Revenue Service and Department of Labor that granted them the church plan exemptions.

Since 1974, the federal employee-retirement law has expressly exempted church plans from its coverage. The statute defines a church plan as a plan “established and maintained for its employees by a church.” At the heart of the case is the scope of a 1980 amendment and whether the “established and maintained by a church” language in the amendment applies as well to organizations affiliated with churches—such as the hospitals in the three cases before the justices.

Several justices had problems with the text at issue and the private letter rulings granting the exemptions.

Justice Elena Kagan called the language “very odd” and “perplexing.”

“There would be a simple way of accomplishing what you think this provision accomplishes,” Kagan said to Blatt during one exchange. “You know, something along the lines of just saying any plan maintained by a church-affiliated organization is a church plan or something like that.”

Justice Anthony Kennedy said the legislative history was “wholly uninformative.” The letter ruling that started the series of exemptions for religious-affiliated health systems was “thinly reasoned,” Justice Ruth Bader Ginsburg said.

Blatt told the justices that religious nonprofits have been exempt from ERISA for more than 30 years “whether or not a church established the plan.” The law’s text, she argued, does not require a church to establish benefit plans for someone else’s employees.

“So whether it’s a pension board that’s either sitting in the hospital or religious charity or it’s a pension board that’s externally incorporated, Congress made sure that the maintaining organization, the one with control over the funds and the administration itself, has to be religiously affiliated,” she said.

Chief Justice John Roberts Jr. questioned how much deference is owed the letter rulings by the IRS and labor department. Under so-called “Skidmore deference,” the lowest deference, Roberts said, “To me, anyway, as it’s been articulated, it seems to be the principle as you should defer to agencies when you agree with their interpretation.”

Blatt said employees in two of the three cases are seeking $11 billion in penalties per year. “That’s $66 billion in two cases if ERISA’s six-year statute of limitations applies,” she said. “The risk that the other side could recover, even any fraction of that amount, is reason enough for you to make sure that the IRS’s decision is somehow unreasonable, that would jettison 30 years of settled expectations.”

Justice Sonia Sotomayor told James Feldman, counsel to the health system employees, that the text could be read either way. Where should she look to break the tie, she asked.

Feldman said Congress wanted a close tie between the church and the plan because “their purpose was they didn’t want to get involved in church affairs. And so they said church plan has to be established and—established and maintained by a church. It needs to fit both criteria because we want—if there’s church involvement here, we want hands off.”

If there were no church involvement, Feldman argued, there would be no reason why these hospitals, like any other hospital in the country, like every other firm in the country, shouldn’t have to provide the employees with the pension insurance to protect them against the possibility that when the plan goes bust, they end up with nothing.”

The three nonprofits have drawn support from more than a dozen religious-affiliated organizations and the Trump administration. The National Employment Lawyers Association, AARP, Pension Rights Center and Americans United for Separation of Church and State filed briefs supporting the employees.

— Read Our website and email newsletters are changing on ThinkAdvisor.