The Supreme Court yesterday expanded the protection against being tried twice for the same crime, ruling that there may be no second trial for a defendant once a judge has voided a guilty verdict because of insufficient evidence.

The court reversed the Louisiana murder conviction of Tracy Lee Hudson, who was tried twice and convicted twice of first-degree murder. After the first conviction, the trial judge threw out the jury verdict saying prosecutors had not proven their case. The government was allowed nevertheless to go ahead with a second trial, bringing forward a new eyewitness whose testimony it had not presented the first time.

In 1978, the Supreme Court ruled that that the double jeopardy clause of the Constitution barred a second trial for a defendant whose conviction was thrown out for insufficient evidence by an appeals court. A unanimous Supreme Court yesterday extended that ruling to such a finding by a trial judge.

The justices also ruled yesterday that a state cannot, by passing a new law, deprive a prison inmate of time off his sentence for good behavior earned under an old law in effect at the time of his crime. The justices decided unanimously that applying the new law to an inmate constituted an unconstitutional ex post facto measure.

Hoyt Weaver was the Florida inmate who brought the case. Weaver pleaded guilty to second-degree murder that occurred on Jan. 31, 1976. He was sentenced to 15 years in prison with, as is standard in most states, "gain time," or time off the sentence for good conduct.

Under the law in effect at the time of the crime, Weaver said he was entitled to get out of jail in December 1984. But in January 1979, a new law took effect that had the effect of extending his release date to February 1987.

The Constitution forbids imposition of punishment for a crime not punishable at the time it was committed and the increasing of punishments beyond their severity at the time of the crime.

The state of Florida argued that "gain time" was not part of the punishment, but a separate matter. But Justice Thurgood Marshall wrote yesterday that a reduction in such time off still "alters the consequences to a crime already completed and therefore changes 'the quantum of punishment'" unfavorably for the defendant.

"The new provision constricts the inmate's opportunity to gain early release and thereby makes more onerous the punishment for crimes committed before its enactment," he said, and "runs afoul of the prohibition against ex post facto laws."

Justice Harry A. Blackmun and Chief Justice Warren E. Burger reached the same conclusion but wrote separate statements. Justice William H. Rehnquist also wrote a concurring opinion.