At a time when it is cutting back on federal outlays for health care, the Reagan administration has decided to allow hospitals to spend Medicare dollars to hire consultants who specialize in blocking unions.

After a heavy lobbying campaign by the hospital industry, the Health and Human Services Department has agreed to pick up the tab for efforts to defeat union drives at hospitals and nursing homes.

The new policy, which abruptly reversed a regulation adopted during the Carter years, quickly drew fire from labor union officials, who said it would cost the Medicare program more than $30 million a year.

"We urge you to reconsider and reverse this wasteful and illegal use of Medicare to finance a multimillion-dollar union-busting industry," John J. Sweeney, president of the Service Employes International Union, said in a letter to HHS Secretary Richard S. Schweiker.

Claire Dorrell, an aide to Schweiker, said that "we found it very difficult to distinguish" between educational activities by consultants, which were covered by Medicare, and antiunion propaganda, which was not. "We are absolutely not antiunion. But the old policy was virtually impossible to administer."

Union officials say there is a growing number of consulting firms that specialize in stopping organizing drives through the use of what they call slick films and pamphlets, intimidation techniques and selective firings. The firms, they say, are hired for about three-fourths of the roughly 500 union elections held each year at health care facilities.

The Carter administration ruled in June, 1979, that payments to lawyers and consultants who work to block unions are illegal because they "are clearly not related to patient care." The policy was later published for public comment and formally adopted on Jan. 16, 1981.

But the American Hospital Association filed suit against HHS, which Dorrell said "forced us to reexamine the policy." When Schweiker's office promised to change the rule, hospital group officials said, they agreed to drop the lawsuit. The policy was changed in January, though never published in the Federal Register.

Dorrell said there was no need to publish the rule change because everyone's views on the issue are well known. She said antiunion activities are related to patient care because they affect hospital employes. She added that the cost to Medicare will be far less than $30 million a year, although she couldn't cite a figure.

Sweeney, whose union represents 250,000 health workers, said, "We were caught completely by surprise. This announcement shocked nearly everyone in the labor movement."

Four House subcommittee chairmen, led by Rep. Henry A. Waxman (D-Calif.), also have written Schweiker that using Medicare money "to finance antiunion activity . . . is totally unacceptable."

HHS agreed to make back payments to hospitals for antiunion campaigns in the last two years, welcome news at such places as Prince William Hospital in Virginia. The hospital will try to recoup $18,000 for a lawyer who fought a successful drive by the service employes' union last year to organize the hospital's 125 registered nurses, assistant administrator Phil Warman said.