The Supreme Court, in a decision that substantially expands the rights of millions of public employes, ruled yesterday that before they can be fired they must be told of the charges against them and given an opportunity to respond.

In another significant ruling, it upheld the federal government's former policy of prosecuting only those youths who publicly refused to register for the draft, saying that the policy did not violate First Amendment guarantees of free speech.

Until yesterday, the high court had never clarified the rights of public employes to their jobs. In its 8-to-1 decision, it said that most public employes have a constitutionally protected due-process right to a hearing before they are fired.

Federal regulations provide protections similar to those mandated by the court. Union contracts and some state civil service systems afford even more protections.

But the decision, which involves an Ohio law, directly affects at least 3 million nonunion public-sector employes, according to a spokesman for the American Federation of State, County and Municipal Employes. A lawyer for the union said that many, if not most, of the 19 states that joined Ohio in this case probably do not give employes such pre-termination hearing rights.

"The point is straightforward," Justice Byron R. White wrote for the majority. "The due process clause provides that certain substantive rights -- life, liberty and property -- cannot be deprived except [under] constitutionally adequate procedures."

White said tenured civil servants have a "property" interest in keeping their jobs. Such a worker is "entitled either to oral or written notice of the charges against him, an explanation of the employer's evidence and an opportunity to present his side of the story."

White said that, at a minimum, the hearing should be a "check against mistaken decisions," which would determine whether there were "reasonable grounds to believe" that allegations against employes are true.

A federal appeals court had held that Ohio's procedures were adequate, White said, because a 1974 Supreme Court opinion said anyone who accepts a job also accepts the procedures set out for dismissal.

That particular view, developed by Justice William H. Rehnquist, "garnered three votes," White said. Given later opinions rejecting that approach, White said, "it is settled that the 'bitter with the sweet' approach misconceives the constitutional guarantee. If a clearer holding is needed, we provide it today," he said.

Rehnquist dissented, saying the majority used "somewhat tortured reasoning" to give public employes new rights. The case is Cleveland Board of Education v. Loudermill and Parma Board of Education v. Donnelly.

The 7-to-2 decision in the draft case, Wayte v. U.S., ratified the Justice Department's initial policy of using "passive enforcement" to enforce then-President Jimmy Carter's 1980 directive ordering eligible males to register for a possible draft.

Under that system, which department officials say has been abandoned, the department did not try to identify and prosecute those who did not register. Instead, it prosecuted only those who told authorities they would not register or nonregistrants whose names were reported by others.

No prosecutions were begun until suspected violators were notified and asked to register. Of hundreds of cases reported, about 17 indictments were handed down.

Justice Lewis F. Powell Jr., writing for the majority, said that even if "passive enforcement" had the effect of discriminating against vocal objectors, there was no proof that the government intended to discriminate against them.

In addition, Powell said that the "passive enforcement program . . . promoted prosecutorial efficiency," and that "prosecuting visible nonregistrants was thought to be an effective way to promote general deterrence, especially since failing to proceed against publicly known offenders would encourage others to violate the law."

Powell said that the limitations on free speech were no more than required to ensure registration for the national defense, and that the interim strategy was needed so the Selective Service System could develop a more "active" strategy to find nonregistrants by using state drivers' licenses and Social Security files.