The Supreme Court yesterday upheld the FBI's right to withhold from the public information it supplied to the Nixon White House about political opponents.

The justices ruled 5 to 4 that information initially gathered for law enforcement purposes retains its legal protection against disclosure, even when the government later incorporates it into records used for other purposes.

"We are not persuaded that Congress' undeniable concern with possible misuse of governmental information for partisan political activity is the equivalent of a mandate to release any information which might document such activity," Justice Byron R. White wrote in the majority opinion.

The Congress, he said, "created a scheme of categorical exclusion; it did not invite a judicial weighing of the benefits and evils of disclosure on a case-by-case basis."

In addition to proving that the material was compiled for a legitimate investigation, the court said, anyone seeking such an exemption from the Freedom of Information Act (FOIA) must also show that disclosure of the information would lead to a specific harm--in this case, an unwarranted invasion of personal privacy.

Advocates of the FOIA expressed disappointment with the ruling, but said they were heartened by its limited scope and by the fact that the court was divided on the issue.

Justice Thurgood Marshall joined Justice Sandra O'Connor in her dissenting opinion, which criticized the majority for "second guessing" the Congress.

The information at issue focused on political critics of the Nixon administration who opposed the war in Vietnam, including economist John Kenneth Galbraith, labor leader Cesar Chavez, and Dr. Benjamin Spock.

Journalist Howard Abramson, now working free-lance in Washington, filed an FOIA request in 1976 for documents the FBI had supplied the White House in response to a request by White House aide John D. Ehrlichman for "name checks" on these people.

After some resistance, the FBI released 80 pages of documents to Abramson, but with numerous deletions. The U.S. Circuit Court of Appeals for the District of Columbia held the deletions were invalid (except for some which may have been duplicates of FBI files). While the information might have been compiled for law enforcement purposes originally, the court found, that was no longer its purpose when it was provided to the Nixon White House.

Yesterday's ruling reversing the Court of Appeals "showed a disappointing naivete" regarding the recalcitrance of government bureaucracies in dealing with such information requests, said attorney Bruce Sanford, who represented a coalition of journalism groups in the case.

But he added that the narrowness of the decision probably means the government can't go much further in any attempts to "Xerox law enforcement information," keep incorporating it into further material and claiming it's protected.

In a separate ruling yesterday, the court significantly strengthened the hand of construction unions by unanimously upholding their right to negotiate agreements under which contractors could hire only union subcontractors for job site work.

Robert A. Georgine, president of the AFL-CIO building trades, expressed "great satisfaction" that labor's position had been fully vindicated.

Writing for the majority, Justice Marshall acknowledged that the measures could give the unions "a powerful organizing tool," and may create a "top-down" pressure for unionization. But he held that this was the intent of Congress, and that in any case these pressures are limited by other parts of the law.

John L. Fielder, president of the Associated Builders and Contractors, said the decision "will severely limit construction employers' options," and "is bound to drive up the cost of construction."

Employer groups argued unsuccessfully that such requirements should be limited to job sites where union members would otherwise be forced to work beside nonunion workers, thus minimizing job site strife.

In other action yesterday:

The court, in a decision involving the issue of "double jeopardy," ruled in favor of a retrial for an Oregon defendant freed during his first trial because of prejudicial statements made by a prosecutor.

The court said that Bruce Alan Kennedy, who had been charged with the theft of an oriental rug, could invoke the double jeopardy protection against a second trial only if the prosecutor's statements were intended to cause a mistrial.

The court was unanimous in its judgment in Oregon vs. Kennedy overturning the Court of Appeals of Oregon. Justice William H. Rehnquist wrote the opinion. Separate concurrences were written by Justices John Paul Stevens and William J. Brennan Jr., joined by Justices Marshall and Harry A. Blackmun.

The court reinstated the Alabama death sentence of John Louis Evans for the 1977 robbery-murder of a Mobile pawnshop owner. Evans had successfully argued at the 5th U.S. Circuit Court of Appeals that a 1980 Supreme Court ruling in another Alabama capital case also could be used to overturn his sentence.

In the 1980 ruling, Beck vs. Alabama, the justices held it unconstitutional to deprive a jury of the option of finding a murder defendant guilty on lesser charges not carrying a death penalty.

Chief Justice Warren E. Burger, writing for the court yesterday, said that option is necessary only where there is evidence of a lesser offense, such as unintentional murder. There was no such evidence in the Evans case, Burger ruled.