On a stage wrapped in red, white and blue bunting, President Reagan yesterday signed a bill to restore the Social Security system to financial solvency and used the setting to preach a political sermon on the benefits of bipartisan cooperation to an audience that included many Democrats.

The president, who is battling with Democrats over the defense budget, the MX missile and his Latin America policy, had fought them over Social Security. He has accused them of making the issue a "political football."

But yesterday Reagan struck only conciliatory chords. He said the cooperation of Democrats and Republicans on the Social Security bill is proof that "our system can still work when men and women of good will join together to make it work."

A detailed list of the amendments to the law signed by the president yesterday is on page A27.

Reagan, who, shortly after taking office, whipped up a storm of criticism with proposals to cut Social Security benefits, said the compromise also "demonstrates for all time our nation's ironclad commitment to Social Security."

"Just a few months ago, there was legitimate alarm and worry that Social Security would soon run out of money," the president said as he stood on a temporary stage behind the White House with House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) and Senate Majority Leader Howard H. Baker Jr. (R-Tenn.).

"On both sides of the political aisle there were dark suspicions that opponents from the other party were more interested in playing politics than in solving the problem. But, in the 11th hour, a distinguished bipartisan commission, appointed by House Speaker O'Neill, by Senate leader Baker and by me began to find a solution that could be enacted into law."

Repeating his bipartisan theme, Reagan said:

"None of us here today would pretend that this bill is perfect. Each of us had to compromise one way or another . . . but the essence of bipartisanship is to give up a little to get a lot. My fellow Americans, I think we've got a great deal. Our elderly need no longer fear that the checks they depend on will be stopped or reduced."

The major provisions of the $165 billion bill, which the president signed with a dozen pens (one for each letter of his name), include delaying the annual cost-of-living increase for Social Security recipients from July until next January. That delay will cost a typical retiree who receives $408 per month about $14 per check.

Also next year, retirees will have to pay taxes on half their Social Security benefits if their adjusted gross income, including half their Social Security, exceeds $25,000 for individuals or $32,000 for couples.

The retirement age will also rise from 65 to 66, at a rate of two months per year between 2003 and 2009, and from 66 to 67 between 2021 and 2027. The amount of Social Security will be cut from 80 percent of full benefits as it is now to 70 percent for those who retire at 62.

In addition, payroll taxes will rise from 6.7 percent to 7 percent in January for employers. Self-employed workers will have to pay 11.3 percent next year instead of 9.35 percent and their payments will rise to 13.02 percent in 1988.

The chilly, windblown crowd of about 800 people on the White House South Lawn with full color guard and Marine Corps musicians included members of the National Commission on Social Security Reform--Sens. Robert J. Dole (R-Kan.) and Daniel Patrick Moynihan (D-N.Y.), Rep. Claude Pepper, former chairman of the Select Committee on Aging, Lane Kirkland, president of the AFL-CIO, and Alan Greenspan, former chairman of the Council of Economic Advisers, who headed the commission.

However, three members of the commission who opposed the compromise--Sen. William L. Armstrong (R-Colo.), Rep. Bill Archer (R-Tex.) and former representative Joe D. Waggonner (D-La.)--were absent.

Other key congressmen attending included Rep. J.J. Pickle (D-Tex.), chairman of the House subcommittee on Social Security, and Dan Rostenkowski (D-Ill.), chairman of the Ways and Means Committee. There also were members of such elderly groups as the American Association of Retired Persons and the National Alliance of Senior Citizens.

O'Neill agreed with Reagan that yesterday was "a happy day for America."

Baker reiterated the bipartisan theme in short remarks: "It is perhaps one of the littlest noticed but one of the most important aspects of the civility of American government that on occasion we can rise above politics and confrontations and address on a bipartisan basis the great challenges and issues that confront the republic," he said. " . . . The preservation of Social Security is one of those issues."