Michael Hightower, 32, a Vietnam veteran, had raped two Idaho women, and had been judged not guilty of both crimes on the grounds of mental illness, when police arrested him last fall for trying to murder a nurse near Everett, Wash.

The resulting outcry, similar to the national outrage about the acquittal of John W. Hinckley Jr. for the shooting of President Reagan, helped lead the Idaho legislature this year to abolish the mental illness defense, joining Montana as the two states to have done so.

Today, inquiries from more than 20 states interested in changing their own laws are pouring in here, and the experiences of these two conservative, sparsely populated states may serve as a model for a sharp change in criminal law throughout the country.

"It's going to eliminate the old game of 'let's see if we can confuse the jury,' " said Greg Bower, chief deputy criminal prosecutor for Ada County, which includes Boise, the state capital.

The new law forbids psychiatric testimony at criminal trials except to determine if the defendant was so deranged that he did not intend to commit the crime at all, and "that's the kind of thing psychiatrists tell you they are unable to diagnose," said David Nevin, a deputy public defender here.

The Montana law, which has the same effect, took force in 1979, but Montana attorneys say it has had minimal impact in a state where few insanity defenses were ever successful anyway.

In Idaho, on the other hand, prosecutors say they anticipate more guilty verdicts when the new law takes effect July 1, while some defense attorneys and mental health officials here decry the change.

"The Hightower case was unfortunate because it is going to spread the desire to do away with the insanity defense," Nevin said. "I have basket cases, literally people who do not know what they are doing, and all those people are going to go to prison."

"When you take someone who has a severe emotional problem and you put that person in a regular prison, you haven't accomplished anything beneficial," said Betsy Gabel, executive director of the Idaho Mental Health Association. "You have no guarantee either that he will stay in prison." She said she expects a challenge to the new Idaho law.

Montana State Rep. Michael Keedy, a Democrat running for a local judgeship, said he conceived the idea of eliminating his state's mental illness defense after reading the work of New York psychiatrist Dr. Thomas S. Szasz, a sharp critic of the use of psychiatric testimony.

"There were no celebrated cases fresh in people's minds," Keedy said, but Montana was a small state with legislators receptive to strict anti-crime measures and willing to experiment. After a close vote in the house of representatives, the measure passed the state senate easily when language was added allowing judges to require convicted defendants to receive psychiatric treatment while in jail.

In Idaho, the law change was initiated by state Attorney General David H. Leroy, a former local prosecutor who shared a growing distaste for the insanity defense with many Idaho prosecutors.

Lynn Thomas, the state solicitor general, said cases like Hightower's also "contributed a good deal to the public impatience."

Hightower was acquitted of rape in 1972 on the grounds that he was mentally defective, and under the law then in effect was sent for treatment to the Idaho security mental facility.

In late 1973 social workers, apparently happy with his progress, transferred him to an unguarded community mental health center here, and he walked away. Two hours after his escape, according to later court testimony, Hightower forced a 22-year-old Boise state college student to drive him to a secluded area, where he raped her. Captured two months later, he was acquitted of that rape charge, also on grounds of mental illness, and was sent back to the state mental facility.

When Hightower asked to be released in 1975 to a less restricted facility, psychiatrists at a hearing gave conflicting testimony on his mental state. Two said he was sane at the time of the rapes. Dr. Karl E. Humiston, a state psychiatrist, argued that Hightower had been mentally unbalanced because of "unstable blood sugar" at the time of the rapes, but would not be a danger "as long as he continues to eat well and avoid sugar and coffee."

News accounts of the testimony caused further public disenchantment with the state's insanity defense. Judge W. E. Smith surprised Hightower by sending him back for trial for one of the earlier rapes. He was convicted and sentenced to 25 years. But the state supreme court reversed Smith's decision in 1980.

Hightower, meanwhile, had been paroled and had moved to Washington, where he worked briefly in a center for juvenile delinquents because of good references from Idaho psychologists. Shortly after Idaho officials sought his return for more psychiatric treatment he was arrested for shooting the nurse and was convicted last month of assault with intent to kill.

Under Idaho's new law, attorneys said, a defendant like Hightower or Hinckley probably would be found guilty. After the guilty verdict, a judge would hear psychiatric testimony to determine if his sentence should include some time under psychiatric care at the state prison.

Nevin argued, however, that judges are far less sympathetic to efforts to plead mental illness than are juries, and that many defendants will be sent to the regular state penitentiary.