The Supreme Court, fefining the limits of sexual equility, ruled yesterday that women may be excluded from the military draft.

Ordinary tests of equality do not apply when Congress is considering the national defense, Justice William H. Rehnquist wrote for the court. In this area, unlike all the others where the court has struck down male-female distinctions, Congress may discriminate between men and women.

Although the case was about the draft registration program, the ruling said the draft itself was the real question.

By a 6-to-3 vote, with Justices Thurgood Marshall, William J. Brennan Mr. and Byron R. White dissenting, the court said Congress designed the registration program to meet emergency situations where combat troops are the primary need. Because women are ineligible for combat Rehnquist said, Congress determined they were not needed either for "purposes of a draft or registration for a draft."

The court should not "substitute" its own judgment by requiring Congress to "engage in gestures of superficial equality," he said. "The Congress is a coequal branch of government whose members take the same oath we do to uphold the Constitution of the United States."

Barring an unlikely change of mind by Congress or, possibly, ratification of the Equal Rights Amendment, the decision means that any draft will be, as it always has been, an all-male affair.

The meaning of the case went well beyond the immediate impact, however. The challenge to the all-male registration, though brought by men, became a symbol for the women's movement. The exclusion came to be considered by many feminists the ultimate badge of inferiority. A victory would enhance chances to ratify the Equal Rights Amendment, they said, and a defeat would seriously damage many future sex discrimination cases.

The decision, said National Organization for Women President Eleanor Smeal, "is a tragedy." Marshall and Brennan said the court "today places its imprimatur on one of the most potent remaining public expressions of 'ancient canards about the proper role of women.'"

For the court, threatened more seriously than it has been in years by proposals to strip it of authority over controversial social issues, including the draft, it was a timely chance to show critics that it knows its place.

The decision, said Rehnquist, shows the court's "healthy deference" to the other branches of government.

The justices reversed a July, 1980, judgment by a three-judge panel that held the draft registration unconstitutional so long as it excluded women. A group of draft-eligible men brought the challenge in 1971, during the Vietnam war, and it lay dormant until President Carter revived draft registration in January 1980, as a response to the Soviet invasion of Afghanistan.

At that time, Carter recommended including women in the registration for the first time in U.S. history. Congress refused last summer to do so, however.

It was that refusal that the Supreme Court judged yesterday in Rostker v. Goldberg.

First, Rehnquist said, any time the court considers the constitutionally of an act of Congress, it should show its "customary deference."

Then he rejected the argument that the registration, because it is imposed on civilians, wasn't a military matter at all and was separate from the issue of induction. "Registration is not an end in itself in the civilian world but rather the first step in the industion process into the military. . . ."

"The case arises in the context of Congress' authority over national defense and military affairs, and perhaps in no other area has the court accorded Congress greater deference," he wrote.

". . . None of this is to say that Congress is free to disregard the Constitution when it acts in the area of military affairs," he said. "But the tests and limitations to be applied may differ because of the military contest."

The only question, he said, was whether Congress "transgressed an explicit guarantee of individual rights." Did Congress act, as the challengers charged, "'unthinkingly'" or "'reflexively and not for any considered reason'" when it rejected women?

Rehnquist said it had not done so. Citing the hearings and debate in 1980 when Carter's proposal was rejected, Rehnquist said Congress had carefully studied the inclusion of women and rejected it because they were ineligible for combat, for reasons of "military flexibility."

"This is not a case of Congress arbitrarily choosing to burden one of two similarly situated groups, such as would be the case with an all-black or all-white, or an all-Catholic or all-Lutheran, or an all-Republican or all-Democratic, registration," he said.

"Men and women, because of the combat restrictions on women, are simply not similarly situated for purposes of a draft or registration for a draft."

Solicitor General Wade H. McCree Jr., who has resigned effective June 30, argued the case for the government, and won one of the government's most significant victories. The draft-eligible men, represented by Philadelphia lawyer Donald Weinberg, the American Civil Liberties Union and Harvard Professor Laurence H. Tribe, had claimed that the distinction violated equal protection guarantees under the Fifth Amendment.

Marshall, with Brennan, agreed. "Even in the area of military affairs," Marshall wrote, "deference to congressional judgments cannot be allowed to shade into an abdication of this court's ultimate responsibility to decide constitutional questions. . . . In some 106 instances since this court was established, it has determined that congressional action exceed the bounds of the Constitution."

"I believe the same is true" of this action, Marshall said. "In an attempt to avoid its constitutional obligation, the court today 'pushes back the limits of the Constitution'" to accommodate an act of Congress.

Marshall and Brennan said the majority misread the testimony before Congress and then applied the wrong standards to it. They said the testimony, most of it delivered by Carter officials favoring a mixed draft, showed that women would be needed for supporting roles in an emergency, and that, in fact, including them in limited numbers would not burden the military.

Even if they were not needed, that does not justify excluding them under the Constitution, they said. Unless the government can show that they would significantly burden military flexibility, it has not made the case for constitutionality.

White, also with Brennan, agreed. The "division among us indicates that the record [of the congressional deliberations] means different things to different people," White said. "The claim is that in providing" for combat troops, "Congress is free to register and draft only men. I discern no adequate justification for this kind of discrimination between men and women," White wrote.

There was debate among lawyers yesterday over the impact of the draft decision on future cases. The majority on the court seemed to ignore its previous standard for judging gender distinctions, but appeared to confine itself to military-related situations.

Equal rights lawyers also were concerned about the court's increasing willingness to accept perceived "differences" between men and women -- combat ineligibility or childbearing capability -- as justifications for discrimination.