When President Reagan sat down to tackle the deficit issue last week, White House officials concluded that prospects were growing increasingly bleak for progress on Capitol Hill toward a budget compromise.

They decided they had little to lose with an abrupt, risky political maneuver: to abandon support for a one-year freeze on Social Security inflation adjustments, the main obstacle to a compromise and the most politically volatile issue in this year's spending debate.

At first, the gamble appeared to pay off, with hopeful statements of "progress" from congressional leaders in both parties. But by week's end, the tactic produced serious new problems for Reagan, who had hoped that his personal involvement would help bridge rifts over the deficit.

Once again, a budget compromise appeared to be slipping away, and miffed Senate Republicans accused the White House of betrayal on Social Security. Senate Majority Leader Robert J. Dole (R-Kan.) accused Reagan of "surrendering to the deficit," and others sharply criticized the president for not demanding a higher price for giving up on Social Security.

The White House appeared to have underestimated the Senate reaction, which boiled over Thursday in a private meeting of senators facing reelection next year.

"Now we've got the worst of all worlds," a senior White House official lamented Friday, saying that Senate Republicans are so angry over the Social Security move that they may decide to kill a budget compromise. A second White House official said, however, that if the budget talks collapse, Reagan will have successfully shifted the blame to House Democrats and their failure to come up with more domestic spending cuts, and away from Republicans and the Social Security issue. A House-Senate conference committee on the budget resumes work Monday.

Moreover, the White House is running out of time. If a budget compromise is not forged in the week ahead, Reagan will probably face a battle over a stopgap continuing resolution in September. Officials fear that could hurt Reagan's planned autumn offensive on overhauling the tax code.

Reagan's struggle with the deficit issue last week was also complicated by Office of Management and Budget Director David A. Stockman's resignation. Although it had long been expected, the announcement that Stockman would depart Aug. 1 to join the Wall Street firm of Salomon Brothers left the administration without its most effective budget warrior.

Officials said that the timing of Stockman's resignation was not linked directly to the decision to abandon the Social Security savings. But, according to close associates, Stockman had privately become doubtful in the weeks before that Congress would significantly cut the deficit this year because of the impasse over Social Security, and, to a lesser extent, over defense spending.

Even though Senate Republicans, with Reagan's backing, had voted the one-year delay in Social Security inflation adjustments -- at some peril to their 1986 campaigns -- Stockman and other White House officials decided that it had to be abandoned. For Reagan to stick by it would have meant certain death for the budget negotiations.

"Things were dead in the water," said one informed White House official. "We had to try and break the logjam. We were trying to get what we can."

Reagan then signaled that he was giving up on the Social Security provision in a series of private meetings with congressional leaders early last week.

"There was a little animosity" from the Republicans, said a White House participant in the meetings. But, this official said, most of the Senate leaders, including Dole, realized that the freeze proposal was dead.

The senators insisted that, in exchange for abandoning Social Security cuts, Reagan must pressure the House to find offsetting savings to fill the gap -- $28 billion over three years, if there is no delay in the inflation adjustment for Social Security and other pension programs.

On Wednesday, the House and Senate negotiators met at the White House for a particularly contentious meeting. "It was messy," said another White House participant. The hopeful talk of a "framework" for a budget deal after the White House meeting masked what occured. Each side took items off the table for possible deficit cuts.

Reagan, for his part, again vowed to veto any tax increase. Social Security was held off-limits, and a defense spending compromise between both chambers was discussed. This put negotiators under new pressure to come up with domestic spending cuts.

Amid the acrimony, the president lapsed into an anecdote about government waste, telling them that there is no justification for federal aid for farm ponds.

Reagan recalled how a farm pond for livestock had been built on his ranch before he bought it, and then the dam broke. When an Agriculture Department official told him he could get government money to fix it, Reagan said he replied, "I don't want it."