The Supreme Court ruled yesterday that judges and juries can impose capital punishment only with "full disclosure of the basis for the death sentence."

They cannot take life - "a different kind of punishment than any other" - on the basis of secret information that neither the defendant nor his lawyer has an opportunity to deny or explain, the court held.

For different reasons, eight of the nine justices voted to spare, at least temporarily, Daniel Wilbur Gardner, 40, of Homosassa, Fla., who was convicted of killing his wife. A judge had sentenced him to die in the electric chair under a Florida death-penalty law.

A Citrus County jury in January, 1974. convicted Gardner of the first-degree murder of his wife, Bertha Mae.

The same day, in a separate sentencing hearing, the trial judge instructed the jury to decide, by majority vote, whether to recommend electrocution or life imprisonment.

In accord with state law, the jurors' recommendation had to take into account two issues: Had the state proved that the crime was especially heinous, atrocious, or cruel"? Was this mitigated by "the influence of extreme mental or emotional disturbance" on Garder?

Mrs. Gardner bad been badly beaten. Her husband, an alcoholic, had been drinking virtually the entire day and night before the killing. Court psychiatrists said he was temporarily mentally impaired. He fell asleep beside the body. When he awoke and sensed his wife might be dead, he sought help, wept and waited for the police to come.

The injury recommended life imprisonment. Meanwhile, the judge ordered a pre-sentencing investigation. When he got the report two weeks later, he overruled the jury and sentenced Gardner to death, on the ground that his crime was "especially heinous . . . " The mitigating evidence was, he said, "none."

The secrecy issue arose because the report contained a confidential section that Gardner and his lawyer never saw. On appeal, a divided Florida Supreme Court affirmed the sentence without reviewing the secret material and without discussing Gardner's claim that the trial court had erred.

In the U.S. Supreme Court, Florida argued that full disclosure of pre-sentencing reports could cause needless delays, occasional disruption of rehabilitation processes, and impede investigators seeking relevant but sensitive data. In addition, the state said, judges can be trusted to sentence responsibly even on the basis of secret information.

In yesterday's opinion, Justice John Paul Stevens rejected all of the defenses, on the ground that they denied due process in a capital case. Justices Potter Stewart and Lewis F. Powell Jr. joined him. Chief Justice Warren E. Burger and Justices Byron R. White and Harry A. Blackmun agreed only with the judgment - to send the case back for a new trial.

White, in a separate opinion, said the constitutional ban on cruel and unusual punishment is violated when secret information is used to select persons for execution.

Justices William J. Brennan Jr. and Thurgood Marshall dissented, reiterating their position that the death penalty is cruel and unusual in all circumstances.

Justice William H. Rehnquist also dissented, wanting to affirm the death sentence on the ground that sentencing procedures never before held unfair "cannot convert that sentence into a cruel and unusual punishment."