The Republican-controlled Senate, voting just hours before President Reagan called for national sacrifice to bring down federal deficits, yesterday voted to give a tax break and new incentives for moonlighting to members of Congress and a pay raise to senior government executives.

Over protests from Sen. Mack Mattingly (R-Ga.) that the Senate had chosen the "wrong time" and "wrong place" to send the "wrong signals to the American people," the Senate:

Voted, 50 to 48, to repeal the $3,000-a-year limit on the amount of money that Senate and House members can deduct from taxes for living expenses associated with their work in Washington, although many of them live almost full-time in this area.

Voted, 50 to 45, to raise the pay cap affecting 46,000 high-ranking federal workers from $50,112 to $57,500 a year, or considerably more than the 4.8 percent increase recommended early this month by Reagan that would bring their annual pay to $52,500.

Voted, 45 to 43, to approve a proposal, passed Wednesday by the Appropriations Committee, to repeal a $25,000 limit on income that senators may earn from fees for making speeches to groups outside of Congress, although a $2,000-per-speech limit was retained.

Then, in a bow to taxpayers, the Senate voted to put a limit on the growth of the Senate payroll and to head off possible spending for yet another Senate office building.

As the Senate was acting, Democrats took over a room just off the Senate floor to serve themselves what they described as a Reagan-style school lunch as a way of protesting the president's budget cuts.

They called in reporters and photographers to watch as they tried to swallow a meat-and-soybean patty, a slice of bread, a few french fries, a gob of ketchup and a partially filled glass of milk. The menu, they said, constituted minimal standards for school lunches under the Reagan program.

"You might as well chew on wool," complained Sen. Henry M. Jackson (D-Wash.), grimacing as he left the room.

The tax break and pay proposals were advanced by Senate Majority Whip Ted Stevens (R-Alaska) as riders to a legislative appropriations bill included in a huge stopgap funding measure for government agencies that Congress must adopt by next Thursday, the start of the 1982 fiscal year.

The proposals were not included in the House-approved version of the measure, and are subject to negotiations in a House-Senate conference.

But House Appropriations Committee Chairman Jamie L. Whitten (D-Miss.) made an unsuccessful attempt to slip the congressional tax break into the legislative money bill early this year, and House Minority Leader Robert H. Michel (R-Ill.) said yesterday that he favors such a measure, claiming also that Reagan has no objections to it.

Aides to Stevens said that raising the federal pay cap would cost the Treasury $217.5 million next year. The Joint Committee on Taxation has estimated that repeal of the $3,000 tax deduction ceiling would cost more than $3 million and give the average member a deduction of about $13,500 a year.

Although Senate Republicans led the charge to cut social welfare programs, in line with Reagan's austerity budget earlier this year, they voted overwhelmingly in favor of increasing tax deductions for themselves and other members of Congress. Thirty-six Republicans favored the proposal, along with 14 Democrats.

Charles McC. Mathias Jr. (R-Md.) and John W. Warner (R-Va.) voted to repeal the $3,000 cap, while Harry F. Byrd Jr. (Ind.-Va.) and Paul S. Sarbanes (D-Md.) voted against it. On lifting the pay cap for federal workers, Sarbanes and Mathias voted yes, while Byrd voted no and Warner was not recorded.

Disputing claims by Sen. William Proxmire (D-Wis.) that repealing the expense deduction cap amounted to a "real Christmas tree for Congress," Stevens contended that it would put legislators on an equal footing with business officials and others who can deduct all of the expenses allowed by the Internal Revenue Service. Members of Congress, he said, should be "treated the same as other business people."

Stevens said the $3,000 lid was imposed in 1952, when congressional salaries were about one-third their current level of $60,662.50. Costs have risen a "staggering amount" since then, making the ceiling unduly restrictive and an act of "discrimination" against members of Congress, he said.

Mattingly, chairman of the appropriations subcommittee on the legislative branch, protested in vain that the existing expense restriction is no deterrent to would-be House or Senate members, judging by the number of candidates in each election.

Members of Congress would not receive a pay increase under removal of the cap for federal workers, although salaries of congressional staff members could rise as high as $59,500 if Senate President Pro Tempore Strom Thurmond (R-S.C.) and House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) agreed to the increase, according to aides to Stevens.

The stopgap funding bill, or "continuing resolution," as Congress calls it, would finance departments at 1981 funding levels through Nov. 20, or until appropriations bills for each department are approved.

The House has approved interim funding through Nov. 1 at somewhat different levels that would allow somewhat lower spending for domestic programs. So far, none of the 13 appropriations bills has received final congressional approval.

Congressional leaders have tried to keep the bill free of controversial items, although Senate approval of more money than Reagan wanted for housing and veterans' programs raises the possibility of a veto, according to Michel. The item is subject to change in conference.