The way was cleared yesterday for mandatory draft registration starting tomorrow of four million young men.

Supreme Court Justice William J. Brennan Jr. ended the legal confusion on the issue -- at least for now -- by granting a government request to block a lower court ruling that would have killed the registration program.

A three-judge federal panel in Philadelphia had thrown the government's registration plan into confusion late Friday by ruling the Selective Service Act unconstitutional because it excluded women. It then ordered the Carter administration not to begin the registration of 19-and 20-year-old men over the next two weeks.

Justice Department lawyers rushed an application for a stay of the order to the Supreme Court Friday night. They argued that the lower court ruling left the country without a means of drafting an army in a national emergency, undercut the president's response to the Soviet invasion of Afghanistan and injected "insurmountablel confusion into a registration system that depends upon the voluntary cooperation of eligible individuals."

Brennan considerd the request because he supervises the judicial circuit that includes Philadelphia. He issued a six-page ruling from his summer home on Nantucket Island, Mass., saying the government's arguments are "considerations of palpable weight."

"Although registration imposes materials interim obligations upon respondents [the class of registration-age men] -- including the duty to appear -- I cannot say that the invonvenience of those impositions outweighs the gravity of the harm to the United States should the stay requested be refused," he wrote.

The young men who register will suffer no irremediable injury. Brennan said, because the registration lists can be ordered destroyed if the lower court ruling is upheld after a Supreme Court review in the fall.

He said he personally felt the prospects for reversal were "fair."

Mark Sheehan, a Justice Department spokesman, said after Brennan's ruling that the registration program will "go forward as planned" tomorrow. "All those who were scheduled to register are now legally obliged to do so," he said.

Failure to register is punishable by a fine of up to $10,000 and up to five years in prison. Groups who have opposed the registration plan view it as a first step toward resumption of the draft that President Nixon abolished in 1973.

Trudi Schutz, a spokesman for the American Civil Liberties Union in New York, which is taking part in the Philadelphia suit, said her group will not try to find other Supreme Court justices to reverse Brennan's order.

"This is an important issue that should be decided in an atmosphere of calm, in a deliberate way, not at the eleventh hour," she said.

Schutz added, though, that the ACLU thought the government would have a hard time proving criminal intent of young men who don't register because of the legal confusion on the eve of the program.

"We're in no way saying that people shouldn't register," she emphasized. "There appears to be a technical obligation because Justice Brennan set the lower court ruling aside for now. But he didn't rule on the merits."

When he recommended a revival of registration in wake of the Soviet invasion of Afghanistan late last year, President Carter said that women also should be registered. But Congress rejected that argument when it appropriated $13.3 million to begin the program.

Despite the last-minute confusion of conflicting legal opinions, administration officials were taking a hard line yesterday on the obligation to register.

Brayton Harris, assistant director of the Selective Service, said in a telephone interview that "the law will be enforced. It's not fair to those who register to let the others go. National defense is a shared responsibility.

"We're only talking about being able to respond to a national emergency," he added. "We're not moving toward a return to the peacetime draft."

Harris said forms will be available at the nation's 34,000 post offices tomorrow for men born in 1960. They will be asked to give their name, address, phone number, date of birth and Social Security number, then show a clerk some identification and sign the card, he said. "It will take about two minutes."

Those who register will be sent a letter of acknowledgement after 90 days, Harris said, and those who don't will be discovered by searching computer lists, such as state driver's license records.

Harris said the Justice Department was prepared to prosecute those who failed to register.

In his ruling clearing the way for the registration program, Brennan cited affidavits from high officials in the Office of Management and Budget, State and Defense departments, and Selective Service Director Bernard Rostker outlining the supposed damage to the United States if the lower court ruling was allowed to stand.

In a response to the government's argument for the stay, Donald L. Weinberg, attorney for the class of potential registrants in the nine-year-old Philadelphia case, scoffed at the claims.

"The plain fact is that the defendants' stay application is written as if the country was under attack and mobilizing to repel by force of arms a foreign aggressor," Weinberg wrote. "Such is not the case today. . . . Nor is there a shred of evidence that such will be the case if the injunction is left in force until Congress chooses whether to enact a draft law which conforms to the Constitution."

Any mass registration should await a decision by the Supreme Court on the merits of the case, Weinberg said. Granting the stay would cause needless confusion though "we think that no criminal intent could conceivably be proven" by young men who fail to register because they relied on the lower court order, he added.

The lower court case was filed in 1971 by young men opposing the war in Vietnam. It was considered moot for a time after the draft was stopped, but was revived again on the issue of sex discrimination in February after Carter raised the registration issue.

Weinberg said in his papers at the Supreme Court yesterday that the opinion of the three-judge panel in Philadelphia "is the painstaking product of the scrupulous study of a trial record of some two thousand page. . . ."

In their ruling, the judges said the government had failed to establish its claim that the all-made draft served an important government objective.

Noting the presence of 150,000 women in the volunteer armed forces, the federal panel said, "the die is already cast for substantial female involvement in the military."

The plaintiffs had argued that excluding women -- half the population -- from the draft discriminated against men by in effect, doubling their chance of being selected for induction in an emergency.

In a related matter, a Gallup Poll released yesterday said that more than 70 percent of both young (18 to 24) and older adults favor the registration of young men for the draft, though only about half of each group favors registration for women.

The poll of 1,242 adults between July 11 and 23 also found that while all adults favor a return to the draft, 59 to 33 percent younger adults oppose it, 56 to 38 percent.

Those polled also favor drafting women, 51 to 45 percent, though the women polled opposed the idea, 50 to 46 percent.