At issue is a program that collects fees from most insurers and uses the money to help pay high-cost claims for sicker people. The purpose of this temporary “reinsurance program” is to stabilize premiums and to encourage insurers to participate in markets under the health care law.

The 2010 law stipulates that some of the money “shall be deposited into the general fund of the Treasury of the United States and may not be used for the program” to provide financial assistance to insurance companies.

The auditors found that the Obama administration had flouted this requirement. Under the law, the government was supposed to collect a total of $25 billion from 2014 to 2016 and deposit $5 billion of that in the Treasury.

The administration set the amount to be contributed by each insurance company, but the total collections fell short of the amounts specified in the law. So the administration allocated almost all the money to insurers, “resulting in the deposit of no amounts in the Treasury,” the accountability office said.

The administration “may not use amounts collected for the Treasury to make” payments to insurance companies, said the ruling, signed by Susan A. Poling, the general counsel of the G.A.O.

The law “very clearly directs” the secretary of health and human services to deposit certain amounts in the Treasury, Ms. Poling said. “The fact that H.H.S.’s collections ultimately fell short of the projected amounts does not alter the meaning of the statute,” she added.

The ruling by the G.A.O. does not directly affect a separate program with a similar purpose that was meant to limit the financial losses of insurance companies under the Affordable Care Act. But it could complicate efforts by the administration to negotiate a settlement with various insurance companies that have sued the government, saying they received much less money than they were promised under this program.

Under the reinsurance program, the government was supposed to collect $12 billion in 2014, but actual collections totaled $9.7 billion. Courts have held that when funds fall short of expectations, a federal agency should try to achieve the “original statutory scheme” as much as possible.