The Senate last night freed its bill to shore up the Social Security system from a controversial amendment to block withholding of taxes on interest and dividends, then turned to work on the bill itself.

The 54-to-43 vote, on a procedural question, came after President Reagan lashed out for the second time in two weeks at the banking industry as a "selfish special interest group" for its sponsorship of the amendment, which sought to postpone the effective date of the withholding provision from July 1 to next January.

Still to be disposed of last night was an amendment by Sen. Russell B. Long (D-La.) to delay inclusion of new federal employes in Social Security until Congress also enacts a supplementary retirement system for them. Long's amendment also would delay inclusion of members of Congress, judges, the president and vice president.

Extension of Social Security to cover federal employes hired after this year is one of several proposals aimed at raising revenues and reducing costs $165 billion over the rest of this decade. Without some such action the giant retirement trust fund could run dry this summer.

The banking industry last week also temporarily held up a jobs and unemployment insurance bill with an amendment to repeal dividend-and-interest withholding.

The president, in a statement yesterday morning, before the Senate voted, denounced the bankers as a "small but highly funded and organized special interest group" using "obstructionist tactics" on behalf of the postponement amendment, sponsored by Sen. John Melcher (D-Mont.).

"We should not accept an amendment designed to prevent the collection of taxes that are already owed on dividends and interest, even if the financial institutions find it inconvenient," Reagan said.

Earlier, Senate Finance Committee Chairman Robert J. Dole (R-Kan.), a leader of the fight against the Melcher amendment, said after meeting with the president that Reagan "threw his glasses down in annoyance" over the holdup of the Social Security bill.

Aides quoted Reagan as having told Dole, "I've had it up to here with the bankers. They're sitting on their keisters when they should be lowering interest rates."

House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) also favored setting aside Melcher's amendment to speed passage of the Social Security bill before the Easter recess starts this weekend. The House already has acted on it. The speaker said of Melcher: "I know John pretty well and I don't know what the hell he's doing out there."

Dole argued that interest and dividend withholding would bring the Treasury $20 billion over the next five years in taxes people now fail to pay.

After the vote removing the Melcher amendment, the American Bankers Association issued a news release saying that it is not spreading distorted information about withholding, that it did not dictate to Melcher or anyone else how or on what bill to attempt repeal, and that its position on withholding is similar to that in the 1980 Republican platform.

In a twist, the AFL-CIO worked closely with Dole and Majority Leader Howard H. Baker Jr. (R-Tenn.) to beat down the Melcher amendment, while the bulk of Senate Democrats voted to keep it on.

In addition to wanting quick passage of the Social Security rescue plan to save the old-age trust fund from insolvency, and to put Social Security on a reasonably sound basis for the next 50 to 75 years, the AFL-CIO had another motive.

The omnibus bill carries a six-month extension of authority for a special federal program providing extra unemployment insurance benefits for workers who exhaust their regular entitlements. The existing authority expires March 31, and if the Social Security bill is not passed by then about 700,000 workers on extra benefits would be dropped from the rolls.

This would include 2,200 in the District of Columbia, 15,000 in Maryland and 7,500 in Virginia. In addition, another 1 million or so who would have received the extra benefits at some time during the next six months might be cut off.

Despite this, only 13 Democrats voted to put aside the Melcher amendment when it was challenged as violating the budget rules by reducing fiscal 1983 revenues; 41 Republicans backed the move.

The Social Security bill is based on recommendations of a bipartisan presidential commission, which on Jan. 15 suggested a speedup of already scheduled tax increases and curtailment of future increases in benefits, together with some other changes, to raise $165 billion over the next seven years. The House passed its version of the bill, 282 to 148, on March 9.

The Senate version, similar to the House on most major provisions, would raise the basic retirement age to 66 after the beginning of the next century and reduce basic retirement benefits then to 5 percent below the level anticipated in current law.

In the immediate future, it would postpone this year's cost-of-living increase in benefits from July 1 to next Jan. 1; accelerate already scheduled Social Security tax increases so that in 1984, employers and employes each would pay 7 percent, instead of 6.7 percent, on the first $38,700 of pay; tax half the benefits of better-off retirees; raise Social Security taxes on the self-employed, and remove the $6,600 annual earnings limit for Social Security beneficiaries by 1994.

Other provisions would extend the unemployment benefits special program and fundamentally change the way change the way the government pays Medicare bills by instituting a prospective payment system setting fixed rates in advance for hospital services to Medicare beneficiaries.