The Senate confirmed Raymond J. Donovan as secretary of labor yesterday on an 80-to-17 vote that made him the last and most controversial member of President Reagan's Cabinet.

Smiling broadly after the vote, Donovan said he felt vindicated in the dispute that had held up his nomination while the FBI and Senate investigators tried to resolve allegations that he and his New Jersey construction company had ties to organized crime.

In a brief news conference on the Capitol steps, Donovan, 50, said he intends to go to work immediately, "be the best [secretary of labor] I can, and help turn this country around." He said he was not worried that he might have to keep looking over his shoulder for fear that new accusations might crop up in the months ahead.

"I'm a basic optimist . . . an idealist," he said. "This town needs more idealists. Idealists don't look over their shoulders."

In action on sub-Cabinet appointments:

The Senate Foreign Relations Committee reluctantly recommended William P. Clark, a California Supreme Court justice, as deputy secretary of state, by a vote of 10 to 4. Three Democratic committee members voiced reservations about Clark, admittedly no foreign policy expert, by voting "present."

"Never again can we accept a man who professes to have no knowledge in the area for which he has been nominated," committee Chairman Charles H. Percy (R-Ill.) warned in reporting out Clark's nomination.

The Senate approved, 91 to 6, the nomination of former deputy CIA director Frank C. Carlucci as deputy secretary of defense.

Carlucci's chief critic, Sen. Jesse A. Helms (R-N.C.), said Carlucci "carries with him the burden of the failed policies of the past," and added that he hopes Carlucci does not start "substituting his own ideas for the policy of the Reagan administration."

The floor debate over Donovan, who drew the most "nay" votes" of any of Reagan's Cabinet choices, preoccupied the Senate for almost four hours.

Advocates, led by Labor Committee Chairman Orrin G. Hatch (R-Utah), contended that Donovan had been severely maligned by an outpouring of unsubstantiated allegations over the past month. They urged his confirmation, partly to illustrate the principle that a man is innocent until proven guilty.

Opponents such as Sens. Sam Nunn (D-Ga.) and Howard M. Metzenbaum (D-Ohio) argued that Cabinet nominees should be held to a higher standard. Nunn, who has headed a number of Senate investigations into labor racketeering, said he felt that this was particularly important in the Labor Department because of its "hollow, half-hearted" reputation for rooting out union corruption.

The allegations, none of which could be corroborated by the FBI, ranged from charges that Donovan made payoffs to organized-crime figures in the late 1960s to maintain labor peace for his company, Schiavone Construction of Secaucus, N.J., to assertions of bid-rigging on state contracts and claims that the company was "mobbed up" by social and business ties with organized crime.

Donovan, who was executive vice president of Schiavone, denied any wrongdoing or improperity by him or his company. The FBI conducted a hurried but intensive investigation of the most specific allegations, most of them most specific allegations, most of them made by a government-protected witness named Ralph Picardo, but largely ignored other, less detailed accusations that came to the bureau's attention early last week.

Hatch protested that the Senate ought not to accept "unsupported allegations and conclusionary hearsay by a convicted murderer [Picardo] or other sources." He emphasized the testimony of FBI officials who said they would have abandoned the inquiry involving Donovan much sooner if it had been a criminal investigation.

Hatch acknowledged that the FBI had not checked into the claims of another protected witness, Patrick Kelly, who said he had heard talk by organized-crime figures in 1977 about alleged bid-rigging involving Schiavone and about asserted ties to members of the Genovese crime family.

But Hatch dismissed Kelly's leads as "puffs of smoke" too vague to warrant second-guessing the FBI and ordering investigators back into the field.

Sen. Edward M. Kennedy (D-Mass.), who led the opposition, said he still thought Donovan had shown a "flawed sensitivity to the dangers of criminal activity."

For instance, Kennedy pointed out that Donovan testified that he had never been informed when a close friend at Schiavone was called before a grand jury investigating labor extortion, even thought Donovan was in charge of labor relations at the company.

Near the end of the debate, Hatch assured Kennedy that if any "substantial allegations" about Donovan arise in the future, "we will have to refer them to the FBI." This, Senate aides pointed out later, could trigger an investigation under the Ethics in Government Act.

Donovan, however, told reporters that he regarded himself as "above suspicion," and said he was anxious to get to work, expressing thanks to President Reagan, who called with congratulations shortly after the vote.

"I'm not a grudge carrier," Donovan added, in reply to another question. "I have to get along with everybody in this town as best I can."