The Supreme Court ruled 7 to 0 yesterday that Virginia violated the First Admendment by prosecuting a newspaper for publishing accurate information about the investigation of a state judged by the Judicial Inquiry and Review Commission.

The bases upon which the commonwealth sued "are insufficient to justify the actual and potential encroachments on freedom on speech and of the press," Chief Justice Warren E. Burger wrote in the opinion for the court. "The operations of the courts and the judicial conduct of judges are matters of utmost public concern.

But he found it "unnecessary" to adopt the "categorical approach" urged by Landmark Communications Inc., owner of the Virginian-Pilot in Norfolk.

As described by the Chief justice, that approach was "that truthful reporting about public officials in connection with their public duties is always insulated from the imposition of criminal sanctions by the First Amendment."

The decision reversed the Virginia Supreme Court, which had affirmed, 6 to 1, the conviction of Landmark for publishing an article Oct. 4, 1975, that accurately described a commission inquiry into the conduct of a judge in Norfolk.

The article named the judge but reported that the commission had filled no formal complaint against him, "indicating either that the five-man panel found insufficient cause for action or that the case is still under review."

A grand jury indicted Landmark for violating a state law that prohibits identification of a judge who is "the subject of an ivestigation and hearing" by the commission.

At the trial, the only witness was Pilot managing editor Joseph W. Dunn Jr. He testified that he had decided to Print the story because the subject was a matter a public importance.

Dunn said he had been aware that it was a misdemeanor for a participant in commission proceedings to divulge information about them, but unaware that the law applied to press reports about the same proceedings.

The trial judge found Landmark guilty and fined it $500. The conviction, first of its kind, had national significance, partly because 47 states, the District of Columbia and Puerto Rico have some sort of procedures for judicial inquiry and discipline.

Except for Puerto Rico, all of the jurdiscitions provide for confidentiality of judicial disciling proceedings. But only Virginia and Hawaii appear to provide criminal sanctions for disclosure by the press or any "third persons" who have no official connection with disciplining of judges.

Affirming Landmark's conviction, the Virginia Supreme Court held that the First Amendment guarantee of freedom of the press was outweighed by the commission's need for confidentiality. Without it, the commsiion "could not function properly," Justice Harry L. Carrico wrote.

Criminal sanctions "are indispensable to the suppression of a clear and present danger posed by the imminent disclosure of the commission's sensitive proceedings," Carrico said.

The dissenter, Justice Richard H. Poff, found "utterly no evidence of record showing a 'clear and present danger.'" He said the commission low violated the First Amendment.

Basically agreeing with Poff, Burger said the news story that led to the Virginia prosecution "lies near the core of the First Amendment."

He found "little more than assertion and conjecture" supporting Virginia's claim that without criminal penalties, there would be serious undermining of such goals of the state as inhibiting unfounded allegations that defame honest judges. More than 40 states with similar commissions don't rely on criminal sanctions to enforce confidentiality, he said.

As for the "clear and present danger" argument, Burger cited cases with more extreme circumstances in which the court had rejected it.