The Supreme Court, expanding the rights of criminal defendants, ruled yesterday that states must pay for psychiatrists for indigent defendants pleading not guilty by reason of insanity.

The impact of the ruling was not immediately clear. The court said 41 states and the federal government already guarantee psychiatrists to poor defendants under some circumstances. The nine states not listed by the court include Maryland and Virginia.

The high court, in its famous 1963 Gideon v. Wainwright decision, said the Constitution's guarantee of a right to a defense lawyer required states to provide lawyers for poor defendants.

In yesterday's 8-to-1 decision, Justice Thurgood Marshall cited that ruling in extending that right to psychiatrists and, by implication, to other witnesses or costs that poor defendants might need to present their cases.

"We recognized long ago," Marshall said, "that a criminal trial is fundamentally unfair if the state [does not provide] access to the raw materials integral to . . . an effective defense."

"Justice cannot be equal," Marshall said, when an indigent defendant is denied fundamental fairness.

Marshall noted that the federal government, 41 states and the District of Columbia, either through legislation or by judicial rulings, have decided that, under certain circumstances, indigents are entitled to a "psychiatrist's expertise."

Those laws and rulings "reflect a reality that we recognize today," he said, that "the assistance of a psychiatrist may well be crucial to the defendant's ability to marshal his defense."

In this case, the court threw out the conviction and death sentence of a man who killed a minister and his wife and wounded their two children during a burglary of their home in rural Oklahoma in 1979.

The court ordered a new trial for Glen Burton Ake, who had requested, but was denied, an independent psychiatrist to help him show that he was insane at the time of the events.

Marshall said the state court improperly denied Ake the psychiatric assistance he had requested, both during his trial and at a separate proceeding in which he was sentenced to death.

Chief Justice Warren E. Burger concurred in the ruling, but said "nothing in the court's opinion reaches non-death penalty cases."

But Justice William H. Rehnquist, the lone dissenter, said he thought the ruling was "far too broad," and said he would limit it to apply only in death penalty cases. Rehnquist also said he would limit "the entitlement . . . to an independent psychiatric evaluation, not to a defense consultant."

Ake's lawyer, Arthur B. Spitzer, legal director of the American Civil Liberties Union here, said, "There is nothing in the opinion that I can see that limits it" along the lines Burger suggested. "It's not at all limited to capital cases," he said.

Spitzer said that, although 41 states provide for psychiatrists for indigents, their laws and rulings afforded "theoretical rights, not practical ones."

State judges have been "chintzy," he said, in approving defense lawyers' requests for money for psychiatrists. "Now [state] judges will know" that their rulings could be appealed and overturned.

The decision sets broad guidelines for judges to consider when reviewing requests for psychiatrists, and apparently for other expert witnesses.

Marshall said judges should consider the seriousness of the offense and the potential penalty faced by defendants, the costs to the state and whether the requested assistance would be especially relevant.

He said that, in this instance, the imposition of a death penalty made Ake's interest in having a psychiatrist "uniquely compelling."

Oklahoma had argued that requiring psychiatric assistance for Ake and others would "result in a staggering [financial] burden," Marshall said. The court majority was "unpersuaded by this assertion," he said, adding that states that provide for psychiatrists have not found the cost especially high.

In cases where psychiatric testimony is clearly needed or when insanity is an issue, Marshall said, the states must provide one.

"Without the assistance of a psychiatrist to conduct a professional examination on issues relevant to the defense, to help determine whether the insanity defense is viable, to present testimony, and to assist in preparing the cross-examination of a state's psychiatric witnesses, the risk of an inaccurate resolution [by a jury] of the sanity issues is extremely high," he said.