The Senate reined in its spending impulses yesterday and rejected a proposal to allow room in next year's budget for continuation of revenue-sharing with local governments, which Congress previously voted to kill at the end of this fiscal year.

Voting 54 to 41, it spurned a proposal from Sen. Daniel Patrick Moynihan (D-N.Y.) to keep the popular $4.6 billion-a-year program alive if the Finance Committee approves the extension as well as funding for it.

It also rejected, 56 to 40, a proposal from Sen. Howard M. Metzenbaum (D-Ohio) to raise taxes by $145 million to expand funding for maternal, child and community health programs.

Then it refused, 49 to 46, to shift $25 million over three years from foreign aid to child-immunization programs, apparently heeding warnings that the transfer could lead to a massive raid on the already slashed foreign aid budget to fund favored domestic programs.

Although the sum involved in the proposed transfer was small in comparison to other budget totals and the margin was close, the child immunization-foreign aid vote appeared significant in helping prevent the Budget Committee's tax-and-spending plan for fiscal 1987 from unraveling on the Senate floor. It is under attack from the White House and GOP conservatives for proposing to curtail defense spending and raise taxes to mitigate domestic spending cutbacks.

Few programs are more popular than child immunization, and few are less popular than foreign aid. Senate Foreign Relations Committee Chairman Richard G. Lugar (R-Ind.) said he wished foreign aid funds "weren't so inviting" a target and warned that several other transfer proposals were lurking in the wings. "Of course, a good case can be made for immunization, but a very good case can be made for peace," he added.

Rejection of the revenue-sharing proposal, the largest item to come before the Senate since it took up the budget Monday, represented a bow to fiscal restraint only a day after the Republican-controlled chamber rejected some of the most tight-fisted provisions of President Reagan's budget.

It voted by a big margin Tuesday to ignore Reagan's proposal to terminate more than 40 domestic programs, ranging from Amtrak subsidies to small business loans, and then approved a $300 million increase in education spending, to be financed by tax increases.

Although Congress voted in its fiscal 1986 budget to terminate the 14-year-old revenue-sharing program at the end of this year, mayors and other local officials have lobbied extensively for its continuation and a House subcommittee has voted to reauthorize it.

In Senate debate yesterday, revenue-sharing proponents contended that local governments relied heavily on the program to finance public safety efforts and avoid sharp increases in property taxes.

Sen. Jim Sasser (D-Tenn.) contended that cutoff of revenue-sharing funds would force a 9.2 percent increase in local property taxes or massive layoffs of police, fire and school personnel. Sen. John Heinz (R-Pa.) said one economically hard-pressed town in his state has had to lay off all its police, firefighting and city hall employes and will "probably have to sell city hall" if revenue-sharing is terminated. Killing revenue-sharing amounts to "deficit shifting" from Washington to local governments, Heinz said.

Opponents argued that Washington has run out of revenue to share and has higher priority needs to meet during a time of fiscal austerity. Revenue-sharing goes largely for programs that "local governments want . . . but are unwilling to fund themselves," said Sen. Slade Gorton (R-Wash.).

Budget Committee Chairman Pete V. Domenici (R-N.M.) contended that reviving revenue sharing would contribute to a budget overload that would cause Congress to miss the Gramm-Rudman-Hollings deficit target for fiscal 1987, triggering end-of-the-year spending cutbacks of $25 billion to $30 billion.

Meanwhile, Senate Majority Leader Robert J. Dole (R-Kan.) joined with Sen. William V. Roth (R-Del.) in introducing a resolution urging an updating of estimates in the budget to account for improving economic conditions.

Such a course has been recommended by Office of Management and Budget Director James C. Miller III to help avoid tax increases and defense cutbacks proposed in the Budget Committee draft. Dole aides said their boss' support of the resolution was not intended as an endorsement of Miller's position, which Domenici has criticized.

In an apparent attempt to work out a budget compromise, Dole met for most of the afternoon with Republican critics of the committee plan. The Senate is scheduled to resume debate on the budget next week.