White House officials view the Social Security compromise reached late Saturday as a badly needed tonic that came at a time when the Reagan presidency is reeling from reports of disarray and lack of leadership.

"This is certainly not consistent with the idea of a presidency in disarray," White House chief of staff James A. Baker III said yesterday. "It shows the president dealing with one of his major problems and doing so in a bipartisan way. He could have washed his hands of this and left it to Congress. Instead, he demonstrated leadership and political courage."

Baker's statement was a stronger characterization of what President Reagan had done than anything contained in the president's own statement announcing the compromise.

"Each of us recognizes that this is a compromise solution," Reagan said. "As such, it includes elements which each of us could not support if they were not part of a bipartisan compromise.

"However," he added, "In the interests of solving the Social Security problem promptly, equitably and on a bipartisan basis, we have agreed to support and work for this bipartisan solution."

What emerged from interviews with Baker and other administration officials yesterday was a portrait of a pragmatic leadership drawn with the understanding that Democrats hold the political upper hand if it comes to a showdown.

"Republicans in Congress were terrified, absolutely terrified, of letting this drift for months and months and become an issue in the 1984 elections," one administration official said.

This fear, shared by the White House negotiators and eventually by Reagan, was that Congress would do nothing until faced with the specter in late spring of Social Security payments being interrupted. At that point, White House negotiators believed that Congress might act to solve the problem by making up the shortfall for one year with general revenue funds.

"What would the president have done then?" a White House official asked rhetorically. "Veto the bill and stop the checks to the old folks? It was a no-win situation."

Another official noted that such action also would have set a precedent for the Social Security solution most opposed by Reagan--making up shortages through general taxes.

Reagan was kept posted throughout the negotiations, officials said. For public consumption, however, the White House always took the view that "nothing was before the president" until an agreement had been reached.

One official acknowledged yesterday that this was an attempt to distance Reagan from the negotiations to minimize political damage in the event they failed.

Because administration public opinion surveys showed the Social Security issue highly damaging to Reagan because of fears that he is or will be responsible for cuts in benefits, White House negotiators were fearful that Democrats would not seriously seek a negotiated settlement at this time.

"I think the Democrats genuinely wanted to solve this more than we believed," Baker said. "They clearly have a political advantage on this issue, and we weren't sure they really wanted to solve it, but they did. People who are skeptical of the political system should take heart from what was accomplished here."

Because of potential political damage to Republicans on the issue, administration officials discount the importance of expected opposition to the compromise from conservatives led by Sen. William L. Armstrong (R-Colo.).

Armstrong was one of three members of the presidential commission who voted against the compromise.

"We've been hearing from other conservatives that the important thing for the party is to get this settled," one administration official said yesterday.

Reagan's behavior in accepting the compromise followed the pattern he has set as president and, earlier, as governor of California. His approach, traced by some who have known him for a long time to his days as a negotiator for the Screen Actors Guild, is to take a hard public line and give no hint of compromise until the last minute when he usually opts for what he can get.

In private conversations, Reagan has occasionally said this is the most effective way of gaining as much as possible from a negotiated settlement.

In California, Reagan signed the largest tax-increase measure in the state's history less than a year after promising to "squeeze, cut and trim" the cost of government.

Recently, he has yielded ground on the defense budget and on previous commitments not to increase taxes.

The Social Security compromise demonstrated the familiar Reagan style of delegating all of the detail and much of the substance of negotiation to trusted advisers, in this case a four-man team headed by Baker.

Guided largely by Reagan's view that as much of the Social Security savings as possible should come from cuts in benefits rather than from new taxes, the team of Baker, presidential adviser Richard G. Darman, Office of Management and Budget Dirctor David A. Stockman and legislative liaison Kenneth Duberstein worked out the substance of the compromise with Democratic counterparts on the commission.

Reagan, as usual, stayed away from the details. But the decision to approve the compromise was his.