The Supreme Court yesterday put a brake on the Reagan administration's deregulation campaign, ruling that officials acted improperly when they did away with the requirement that all new cars have air bags or automatic seat belts.

The decision, unanimous on most of the crucial points, was the first major Supreme Court test of the administration's efforts to ease government regulation of business.

The court said the 1981 administration action throwing out the passive restraint regulation was "arbitrary and capricious," unsupported by sound reasons or facts, and a breach of the legal mandate to achieve highway safety. It is all right to rescind this or any other rule, the court said, but greater care and more substantial justification are required.

Justice Byron R. White, writing for the court, strongly suggested that the administration had deferred "to the industry's failure to develop safer cars," reminding it that "the Motor Vehicle Safety Act was necessary because the industry was not sufficiently responsive to safety concerns."

The decision, while in no way crippling the deregulation effort, is likely to make government officials think harder and longer about their actions and is likely to make deregulation more vulnerable to court challenge.

The justices did not say that all cars must have passive restraints, which the insurance industry says could save tens of thousands of lives. Nor does the ruling mean air bags will be required soon. White returned the controversy to the National Highway Traffic Safety Administration in the Department of Transportation for further, more reasoned action.

Secretary of Transportation Elizabeth Hanford Dole, who is thought to be sympathetic to passive restraints, said yesterday that she "welcomed the opportunity to review this matter under the guidance provided by the Supreme Court . . . . I have indicated that I have no higher priority than to insure safety."

Consumer activist Ralph Nader said, "The court has told Reagan that there are limits beyond which it will not tolerate deregulatory fanaticism. It's the beginning of a recognition that laws mean what they say and say what they mean."

Government lawyers said the ruling could have come out a lot worse for the administration. The U.S. Court of Appeals in Washington, in a ruling by Judge Abner Mikva, had imposed much more stringent requirements for such rule changes. The Supreme Court rejected those requirements yesterday at the same time that it agreed that the rescission was improper.

That partial win, combined with a passing comment in the opinion that "the agency is correct to look at the costs as well as the benefits" of a rule change, prompted a sweeping statement of victory late yesterday from the Office of Management and Budget.

The case began when the Department of Transportation announced that it was withdrawing the Carter administration's order requiring either automatic seat belts or air bags in all new cars. The order was to be phased in beginning in 1982.

President Reagan's first transportation secretary, Drew Lewis, reopened the issue as part of the deregulation campaign, ultimately rescinding the order saying the DOT was no longer able to find that the automatic restraint requirement would produce significant safety benefits.

The primary reason given was that the automatic seat belts developed by the auto manufacturers could and would be detached by car occupants. The highway safety agency said 99 percent of the manufacturers planned to use the belts, rather than air bags, to comply with the requirement and that car occupants then would be even less inclined than they are now to use any form of restraint.

The rescission was challenged by the insurance industry, including State Farm Mutual Insurance, and defended by the administration and the Motor Vehicle Manufacturers Association. The administration argued in Motor Vehicle Manufacturers Association et al vs. State Farm Mutual Automobile Insurance Co. et al that the definition of "arbitrary and capricious" was being applied too strictly.

Agencies eliminating rules must follow the same careful procedures they follow when creating rules, White wrote. "The agency must examine the relevant data and articulate a satisfactory explanation for its action," he said.

The administration failed to do this, White said. The highway traffic safety agency said automatic seat belts were not feasible because they were detachable, White said, but it did not explain why it then did not eliminate the problem by ruling out detachable belts.

The agency was "too quick to dismiss the safety benefits of automatic seat belts . . . . We start with the accepted ground that if used, seat belts unquestionably would save many thousands of lives and would prevent tens of thousands of crippling injuries."

Even if seat belts were counterproductive, White said, "this hardly constitutes cause to revoke the standard itself." The agency could have required air bags in place of automatic seat belts, he said.

"Given the effectiveness ascribed to air bag technology by the agency, the mandate of the safety act to achieve traffic safety would suggest that the logical response to the faults of detachable seat belts would be to require the installation of air bags," White said.

"At the very least this alternative way of achieving the objectives of the act should have been addressed and adequate reasons given for its abandonment. But the agency not only did not require compliance through air bags, it did not even consider the possibility," he said.

Justice William H. Rehnquist, joined by Justices Lewis F. Powell Jr., Sandra Day O'Connor and Chief Justice Warren E. Burger, agreed that the air bag determination was "arbitrary and capricious" but dissented from White's holding that faulted the NHTSA's treatment of detachable seat belts.