The Supreme Court ruled 6 to 3 yesterday that a California man convicted 23 years ago of murder must be given a new trial or freed because blacks were purposely excluded from the grand jury that indicted him.

Justice Thurgood Marshall, writing for the majority in Vasquez v. Hillery, said the court, beginning more than 100 years ago, has consistently reversed convictions if grand jurors were excluded for race.

"Intentional discrimination in the selection of grand jurors is a grave constitutional trespass," Marshall said, and overturning the conviction, "the only effective remedy for this violation, is not disproportionate to the evil that it seeks to deter."

The 12-page opinion sparked an impassioned 19-page dissent by Justice Lewis F. Powell Jr., who said it was "difficult to reconcile this result with a rational system of justice."

Powell, joined by Chief Justice Warren E. Burger, and Justice William H. Rehnquist, said the majority's ruling "seriously disserves the public interest."

Powell said there was no evidence that the exclusion of blacks from grand juries in Kings County, a practice that ended 19 years ago, made any difference in the valid conviction of Booker T. Hillery Jr. in 1962.

Powell said Hillery will probably be freed "for no good purpose" because of the difficulties of retrying a case 23 years after the crime had been committed.

In another opinion, the court ruled that if suspects remain silent after being read the 1966 Miranda warnings, their silence cannot be used against them as evidence of sanity at the time of arrest.

The case, Wainwright v. Greenfield, involved a man who sexually assaulted a woman in woods near Sarasota, Fla. The man, David Wayne Greenfield, was arrested about two hours after the assault. He was told, under the Miranda ruling, that he had a right to remain silent and to have a lawyer present during questioning.

Greenfield said he wanted to talk to a lawyer and thanked police for informing him of his rights. Greenfield later pleaded not guilty by reason of insanity. The local prosecutor argued to the jury that Greenfield's repeated refusal to answer questions without a lawyer showed he was not insane at the time of the assault.

State officials argued that while it was impermissible to use a suspect's silence as evidence of guilt, it was proper to use it to refute a claim of insanity.

Justice John Paul Stevens, joined by six justices, disagreed. Stevens said the court had held that "Miranda warnings contain an implied promise, rooted in the Constitution, that silence will carry no penalty." Stevens said it was "fundamentally unfair for the Florida prosecutor" to use Greenfield's "postarrest, post-Miranda warnings silence as evidence of his sanity." Justice Rehnquist, joined by Chief Justice Burger concurred in the result.

Civil liberties lawyers yesterday said the two rulings were mostly significant for what they did not say. In recent terms the court has limited suspects' rights in a number of areas, including federal court review of state convictions and the scope of the Miranda ruling. The court was expected to continue the trend in these and other cases decided this term, according to American Civil Liberties Union lawyer Charles Sims. "But that doesn't seem to be the case so far this term," he said yesterday.