The Republican-controlled Senate handed President Reagan the first big legislative loss in his 20 months in office yesterday as it defiantly joined the Democratic House in overriding his veto of a $14.1 billion appropriations bill.

The Senate's vote was 60 to 30, precisely the two-thirds margin necessary to override a veto. The House overrode the veto 301 to 117 Thursday.

In both houses, nearly half the Republicans joined a virtually solid block of Democrats in spurning last-minute appeals from Reagan and putting the bill into law without his signature.

But Reagan's defeat was especially crushing in the previously super-loyal Senate, where even Reagan stalwarts like Budget Committee Chairman Pete V. Domenici (R-N.M.) broke ranks and flatly denied the president's contention that the bill was a "budget-buster."

"I don't suggest we're busting the budget, but I don't want to bust the president either," said Senate Finance Committee Chairman Robert J. Dole (R-Kan.) in trying to portray the issue as one of support for a president who is on the threshold of achieving an economic recovery.

Majority Leader Howard H. Baker Jr. (R-Tenn.) struck a similar theme, saying the entire "partnership" between Reagan and Congress was at stake. But their angry colleagues would not buy that line. Instead, they pointed out that the bill was within the congressional budget and actually added up to nearly $2 billion less spending than Reagan requested. And they accused Office of Management and Budget Director David A. Stockman of giving Reagan bad advice in urging a veto.

"By no responsible account can this be called a budget-buster, as it has been characterized by the bean-counters at OMB," said Appropriations Committee Chairman Mark O. Hatfield (R-Ore.).

"Frankly I'm getting sick and tired of David Stockman and his mirror acts . . . .He's not serving the nation well, he's not serving the president well, he's not serving his party well," added Sen. Mark Andrews (R-N.D.).

And House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) called on Stockman to quit on grounds that he had not kept the president fully informed on what was in the bill.

Reagan said after the vote, "I'm not just angry. I'm terribly, terribly hurt," and vowed to continue vetoing money bills that he regards as excessive. "I'm disappointed but it doesn't change my mind any about what I'm going to do. I intend to veto budget-busting bills and I will continue to do it," the president added.

But senators said in the debate that their political loyalties had been stretched beyond the breaking point with Reagan's veto of a budget-complying bill to fund popular programs like jobs for the elderly.

"I've swallowed hard many times, I've held my nose on many occasions to be part of the majority . . . , " said Hatfield in what he described as a reluctant break with Reagan, "but there comes a time when conscience and principle transcend loyalty to one's party and one's president."

The veto override -- the first for Reagan on a money bill -- averts layoffs by many government departments and agencies, including the Pentagon, that needed funds from the bill to meet payrolls next week.

But, with many lawmakers as angry as Reagan over the veto issue, more confrontations are expected as Congress takes up appropriations for the new fiscal year starting Oct. 1.

Government by veto "may be good politics but it's lousy government," declared Andrews.

Of the 47 Republicans who voted yesterday 21 broke with Reagan and supported the veto override. Democrats were virtually unanimous in supporting the override, with only Sens. Russell B. Long (D-La.), J. Bennett Johnston (D-La.) and Howell Heflin (D-Ala.) voting with the president. Sen. Harry F. Byrd Jr. (Ind.-Va.) also supported Reagan.

Of the 10 absentees, seven were Republicans, although an Associated Press check of the missing senators' offices indicated that all but one of the 10 would have voted to override the veto if they'd been on hand for the vote. The one was Armed Services Chairman John G. Tower (R-Tex.), who flew home to Texas only yesterday morning for a political engagement.

In a frantic effort to round up enough votes to sustain the veto, Sens. Orrin G. Hatch (R-Utah) and Paul Laxalt (R-Nev.) were flown back to Washington from their home states by Air Force jets, which Senate Democrats quickly calculated to cost the taxpayers a total of $11,200 for fuel alone.

Reagan himself called at least 17 senators from both parties, according to Senate sources, convincing some but failing to sway others including Domenici, whom he called twice.

And, according to Senate sources, Interior Secretary James G. Watt was dispatched on 30 minutes' notice from Andrews Air Force Base to stand in for Sen. Malcolm Wallop (R-Wyo.), who was scheduled to speak in Oregon but was needed in Washington for the veto vote.

On the Senate floor, Baker scrambled to find a senator who would agree to withhold his vote to "pair" with Tower, who would have voted with Reagan. But, despite a flurry of pointing and gesturing, not a single senator volunteered.

In the debate, most of Reagan's defenders avoided mention of the reasons he cited in vetoing the measure last month. He had said it provided too little for defense and too much for domestic programs, including $918 million for popular programs like community service jobs for the elderly, education for the handicapped and grants to needy college students.

The strongest support for Reagan came from Sen. Harry Byrd, who said he was not surprised that the Democratic House overrode the veto but would be "astonished and indeed alarmed if the Republican-dominated Senate voted to override the president's veto of a bill that adds tremendously to spending by the government."

More persuasive, however, was Domenici, who said that Reagan's own proposals, which included $2.1 billion more for defense than the bill provided, would have added $1.4 billion more to the deficit than the proposed legislation would do. "This is not a controversy over fiscal discipline," said Domenici, but rather a matter of legislative priorities.