The Republican Senate followed the Democratic House yesterday and voted to restore the only major Social Security benefit that President Reagan was able to get Congress to cut during the summer.

The Senate agreed, 95 to 0, to preserve the $122-a-month minimum benefit for all but a handful of the 3 million people it now helps. Without the minimum their monthly payments would fall.

Repeal of the minimum in last summer's budget bill caused such furor that the House, on July 31, the very day it was sending the bill to the president, also passed, 404 to 20, a countervailing bill restoring the minimum not only to the 3 million existing beneficiaries but for future retirees.

The Senate version would reinstate the benefit, with certain exceptions, only for those already receiving it, leaving future retirees eligible only for their earned benefit, even if it is less than the $122-a-month minimum. However, nuns retiring in the next 10 years would continue to be eligible for the minimum under the Senate bill.

The Senate bill also would reallocate to Social Security's depleted old-age trust fund some of the tax revenue now assigned to the better-off health insurance and disability funds.

Sen. Daniel Patrick Moynihan (D-N.Y.), speaking for the Democrats, said this reallocation would be enough to shore up the old age fund at least through this decade, under normal economic circumstances, and, with some luck, perhaps for another generation.

This would make it unnecessary to impose the kind of long-range benefit cuts Reagan proposed May 12 but has withdrawn, also because of adverse public reaction.

But the bill's floor managers, Finance Committee Chairman Robert J. Dole (R-Kan.) and Social Security subcommittee Chairman William L. Armstrong (R-Colo.), said that, while they supported reallocation, it is merely a "stopgap" and "the easy way out." If the economy performs poorly, they said, the trust funds could run short of cash by 1984.

Before passage the Senate crushed, 65 to 30, an amendment by Thomas F. Eagleton (D-Mo.) to reinstate a windfall profits tax on newly discovered oil and pump the proceeds, $14.2 billion over the next decade, into Social Security to secure the trust funds.

Eagleton said the cut in the windfall tax from 30 to 15 percent in last summer's tax bill was "an absolute gift to the oil companies."

But Dole said the windfall cut was "the one supply-side provision we adopted" in the tax bill. He said the amendment would pump general revenues into the Social Security system, thus breaching the existing principle that benefits be supported by an equal tax on employers and employes.

All Virginia and Maryland senators except John W. Warner (R-Va.) voted against killing the Eagleton amendment.

The Senate restoration of minimum benefits applies to everyone on the rolls except an estimated 30,000 recipients living outside the United States and up to 350,000 persons receiving federal, state and local government pensions.

For these public employes the so-called "windfall" portion of their Social Security minimum benefit would be reduced dollar for dollar to the extent that their public employe pension exceeds $300 a month.

To make up savings lost by restoring the minimum benefit, the bill also would make sick pay subject to the Social Security tax for the first six months of illness, and limit the total Social Security benefits any family could receive.

A last-minute, unrelated amendment to the bill also would extend the federal gasoline tax to 1989 and the highway trust fund to 1990.

The bill now goes back to the House, where Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and others probably will seek to restore the minimum benefit for all 3 million now on the rolls, without exception, and also future retirees.

In a related development, it was learned that Senate Minority Leader Robert C. Byrd (D-W.Va.) probably will name Moynihan and AFL-CIO President Lane Kirkland as his nominees to a 15-member commission the president wants to create to study long-range Social Security problems.

O'Neill is expected to name Rep. Claude Pepper (D-Fla.) and Robert Ball, former Social Security commissioner who has been spearheading public opposition to Reagan's proposed cuts. Reagan proposed the bipartisan commission to devise alternatives after he withdrew his proposed benefit cuts earlier this year.

In another action yesterday, Office of Management and Budget director David A. Stockman responded to Senate misgivings about Reagan's latest budget-cut proposals by indicating willingness to negotiate with Congress and accept a different "mix" of cuts.

But he defended the overall goal of $16 billion in new spending cuts and revenue-raising measures as essential to recovery, and ridiculed speculation that he might acquiesce in a deferral of future tax cuts.

"The last thing we would ever want to do is delay the implementation" of tax cuts Congress approved last summer, Stockman told the Senate Budget Committee in a final appearance before it begins setting budget ceilings for fiscal 1982.

While renewing his support for presidential vetos of "budget-busting" appropriations bills, Stockman stopped short of saying that he would urge rejection of any bills that exceed Reagan's new budget targets.

"My intention is to recommend he veto bills if they are way over the budget," said Stockman, without defining the criteria any further.