High-ranking White House officials said yesterday that Secretary of Labor Raymond J. Donovan has been so damaged by the investigation into allegations of ties to organized-crime members that even if he is formally cleared, he will have to leave the Cabinet on grounds of impaired political effectiveness.

"The special prosecutor cannot exculpate on political effectiveness," one official said.

This official expressed the view -- which is clearly the hope of several administration officials -- that Donovan would come to this conclusion himself and voluntarily step down even if he is cleared in a report by special prosecutor Leon Silverman, which is expected in the next few days.

Asked whether the White House would like Donovan to step aside on his own, the official replied: "From a purely political standpoint, it wouldn't be unwelcome."

While this view is increasingly prevalent at the White House, no effort is being made to persuade Donovan of it, officials said. Officially, the White House view remains the one laconically stated again yesterday by deputy press secretary Larry Speakes when he was asked whether new allegations linking Donovan to mobsters had alarmed the president.

"No change," Speakes said tersely.

He also said that President Reagan had not talked to Donovan, who was in Europe, in recent days, and described as "bunk" published reports that a list of prospective replacements for Donovan has been prepared at the White House.

Despite this public support, there is growing awareness at many levels of the White House of the damage Donovan is causing the president politically. The prevailing view is that the secretary of labor is unlikely to survive a report that clears him of criminality but confirms in any way that he once associated with known mobsters.

"It's unfortunate and may be unfair to Ray," said one official yesterday. "But he's been so chewed up by this investigation that we don't, in effect, have a secretary of labor."

There is, however, a strongly felt minority view in the White House that presages a major battle that the president would have to resolve if Donovan is cleared of criminal wrongdoing. This is the opinion expressed yesterday by a Donovan supporter that it would be "outrageous" of Reagan to dump a loyal official on the basis of unproven allegations if the special prosecutor finds there is no basis for criminal action.

"Where would it stop?" this official asked rhetorically. "How could you justify it? Who would be next?"

While Reagan, both as California governor and president, has jettisoned his share of political liabilities, he has also shown a willingness on occasion to stand up to his own staff on questions of principle. In the Donovan affair, unless the special prosecutor's report raises questions about the legality of the secretary of labor's conduct, Reagan is certain to be facing divided counsel on a course of action, with the prevalent view likely to be that Donovan should go.

But an official close to both the secretary of labor and the president said yesterday that Donovan impressed Reagan when they met before the president's recent European trip.

Reagan looked Donovan in the eye and asked if he were innocent of the allegations.

"Yes, Mr. President," said Donovan, who also expressed the view that other "innocent people" in the administration would be attacked if he were forced out.

Reagan accepted this argument, pending the conclusion of the investigation. It is now the hope of various White House officials that once the report is in, Donovan will spare the president the necessity of making a decision by deciding to leave on his own.