A closely divided Supreme Court ruled yesterday that members of the public have "no constitutional right" to attend criminal trials.

The guarantee of a "public trial" in the Sixth Amendment is for the benefit of the accused alone, Justice Potter Stewart wrote for a 5-to-4 majority.

Three of the justices who signed the opinion interpreted its scope in three different ways. It was denounced by an extraordinary alignment of dissenters and by press spokesmen and experts on constitutional law.

At Harvard Law School, constitutional specialist Laurence H. Tribe saw the decision as a far-reaching "threat to a free press and an informed citenzenry . . . There will be no need to gag the press if stories can be choked off at the source."

For the American Civil Liberties Union, staff counsel George Kannar said the decision "would have let the Nixon administration accept a guilty plea from the Watergate burglars behind closed doors."

The court acted in a New York State case in which a judge granted a defense motion - accepted by the prosecution - to close a pretrial hearing on whether certain evidence should be suppressed on the ground that it had been obtained illegally. As a result, a reporter was barred from the courtroom.

All of the justices who signed Stewart's opinion agreed that when a defendant, the prosecutor and a trial judge decide to close such a hearing to preclude possibly prejudicial publicity, the public has no independent constitutional right to access.

One of the signers, Cheif Justice Warren E. Burger, wrote a separate opinion "to emphasize" that a hearing on a motion to suppress evidence "is not a trial; it is a pre trial hearing." The Sixth Amendment, he pointed out, speaks only of the right of an accused "to a . . . public trial."

By contrast to Burger's seeming effort to confine the reach of the ruling, Justice William H. Rehnquist, another signer, wrote separately "to emphasize" that the court, "without qualification," held that the public has no constitutional right under the Sixth Amendment to attend criminal trials.

It the parties agree on a closed proceeding, Rehnquist said, the amendment doesn't require the judge "to advance any reason whatsoever for declining to open a pretrial hearing or trial to the public."

A third justice, Lewis F. Powell, Jr., wrote in concurring with Stewart that there are "limitations" on closing pretrial proceedings and that they require the "careful attention" of judges.

Because of "the importance of the public's having accurate information concerning the operation of its criminal justice system," Powell wanted to hold "explicitly" that the reporter - for the Gannet Co. Inc. newspapers in Rochester, N.Y - had "an interest" under the First Amendment in attending the hearing.

But Rehnquist said the court "has emphatically rejected the proposition advanced (by Powell) that the First Amendment is some sort of constitutional 'sunshine law' that requires notice, an opportunity to be heard and substantial reasons before a governmental proceeding may be closed to the public and press.

Of the five signers of the majority opinion, only Justice John Paul Stevens did not write a separate opinion.

By contrast with the unconcealed divisions in the majority ranks, the dissenters spoke their views in single 44-page opinion.

Two of them, Justices William J. Brennan Jr. and Thurgood Marshall, had been counted on by press groups to support the press viewpoint, because they often have taken strong pro-First Amendment stands.

But observers were startled to find among the dissenters two justices who, on the basis of their track records, had been expected to be on the other side.

They are Justice Harry A. Blackmum, a Nixon appointee who wrote the dissenting opinion, and Justice Byron R. White, who wrote the recent opinion for the court when it ruled that libel litigants have a right to explore a journalist's thoughts and editorial processes.

Allen H. Neuharth, chairman and president of the Gannet chain and of the American Newspaper Publishers Association, said the decision is "another chilling demonstration that the majority of the Burger court is determined to unmake the Constitution.

"This case is not simply a matter of free press vs. fair trial. Rather, it is the Supreme Court saying that the judiciary is a private judicial club, which can shut the door and conduct public business in private.

Jack Landau, executive director of the Reporters' Committe for Freedom of the Press, denounced the court for "judicial censorhsip of the rankest kind . . . the First Amendment does not give to the judiciary the power to decide what is news-worthy in their courts. . . ."

The key point at issue between the majority and the minority was the intent behind the guarantee of a public trial as revealed by English and American history.

For the majority, Stewart said the history "totally fails to demonstrate that the farmers of the Sixth Amendment intended to create a constitutional rightt in strangers to attend a pretrial proceeding." Rather, he said, the amendment confers the right to a public trial "only upon a defendant and only upon a defendant and only in a criminal case."

By the time the Constitution was adopted, Stewart said, "public trials were clearly associated with the protection of the defendant. And Pretrial proceedings, precisely because of the same concern for a fair trial, were never characterized by the same degree of openness as were actual trials.

For the dissenters, Blackmum wrote that in casting aside the interests of the public and press "as of little value," the majority's "wooden approach is without support" either in legal history or in the intent of the Sixth Amendment.

Then, drawing on exhaustive research, he said that history reveals "an unbroken tradition at English common law of open judicial proceedings in criminal cases" that was transplanted to the American colonies. In 1977 in New Jersey, for example, the first public trial provision in America said that "any person . . . may freely come into, and attend the said courts, and heat and be present . . . that justice may not be done in a corner nor in any cover trial."

Blackmum found "no basis" in the Sixth Amendment for inferring what a public trial was intended to belong to the accused without "full and fair consideration" of the public's fundamental interest in openess. He cited the protection against perjury provided by publicity, and the need for the public to be able to see how judges and prosecutors - some of them elected - perform.

He also stressed "the appearance of justice." Public confidence cannot long be maintained where important judicial decisions are made behind closed doors and then publicly announced in conclusive terms, he said.

"The ability of the courts to administer the criminal laws depend in no small part on the confidence of the public in judicial remedies, and on respect for and acquaintance with the process and deliberations of those courts," Blackmum said. "Anything that impairs the open nature of judicial proceedings threatens to undermine this confidence and to impede the ability of the courts to function.

In 1965, he recalled, Stewart himself, in a dissenting opinion, said, "The suggesion that there are limits upon the public's right to know what goes on in courts causes me deep concern."

Stewart wrote yesterday that the criminal justice systems presumes that the public interest is protected by participants in litigation, including prosecutors who are obligated not to win but to see that "justice shall be done."

But Blackmum rejected this, raising "the specter of a trial or suppression hearing where a defendant of the same political party as the prosecutor and the judge - both of whom are elected officials perhaps beholden to the very defendants they are to try - obtains closure of the proceeding. . . "