The Senate yesterday refused to do to sugar and tobacco what it had done to milk and peanuts the two days previously. It sustained a new sugar price-support program while fending off efforts to upend the tobacco program.

The fractured farm coalition knit itself at least temporarily together, which was good news for floor supporters of the four-year farm bill, though some said bad news for sugar consumers.

Sens. Paul S. Tsongas (D-Mass.) and Dan Quayle (R-Ind.), soundly trounced in their effort to kill the sugar program, warned that the support scheme will cost consumers millions of dollars in higher prices if it becomes law.

Their amendment, tabled 60 to 33, came up for them at the worst possible time, with farm-state legislators suddenly rebelling against pressures to make further cuts in federal farm spending.

Before the Senate adjourned early today, it became entangled in debate over another politically powerful commodity: tobacco.

Southern tobacco senators worked feverishly throughout the day to line up their usually formidable forces to defeat an amendment by Sen. Mark O. Hatfield (R-Ore.) that would have killed the entire tobacco support system.

After strenuous debate, the Senate voted, 53 to 42, to table Hatfield's amendment.

Hatfield called the allotment system "feudalistic" and charged that tax subsidies in the program have gone well beyond $600 million. Tobacco supporters argued that elimination of the program would demolish thousands of small farm families dependent on income from the leaf.

As debate closed, Hatfield wrily said the Senate apparently had concluded, judging from the mini-benefits enumerated by tobacco advocates, that "tobacco is better than sex." Leading tobacco defender Jesse Helms (R-N.C.) responded, "I don't remember."

The Senate also tabled, 48 to 45, an amendment by Sen. Thomas F. Eagleton (D-Mo.) that would have altered the tobacco support program by creating new loan levels to encourage exports.

Eagleton was preparing to return today with a more worrisome amendment that would end acreage allotments, the exclusive government franchises leased by their owners to farmers in the southern growing areas.

For sugar, however, the change was in a different direction. The cane and beet industry, after an intensive lobbying campaign, won inclusion of a new price support program in the legislation.

As reported by the Agriculture Committee, the bill provided a support of 19.6 cents per pound for sugar. But bowing to White House pressure to trim back all programs, the committee settled on an 18-cent support, which is about 4 cents above New York market prices this week.

Sugar had the extra impetus of a hands-off approach by administration lobbyists. President Reagan, originally not a supporter of a sugar program, pledged his help in return for southern votes on his tax cut bill this summer.

Quayle and Tsongas argued that the committee proposal violated the spirit of the administration's insistence on free-market agriculture and less government regulation.

They said that for every 1-cent increase in the support price, consumers would face an additional bill of $300 million for their sugar, a situation they said would intensify inflation and unjustly prop up U.S. producers.

"There probably is not a more interesting test of getting the government off our back than this farm bill," said Tsongas, who called the regulatory implications of the program "mind boggling."

But senators from the sugar cane and beet states--Hawaii, Florida, North Dakota, Montana, Louisiana among them--insisted that without price supports the domestic industry would continue to shrivel and U.S. consumers would become hostage to foreign growers.

Sen. Russell B. Long (D-La.) played at the heart strings that make lovely music in the Senate. He said that unskilled black workers, with no place to go, would be put out of jobs if his state's sugar industry failed.

"You will put these poor souls out of jobs, put them on the welfare," he said. "You will make them welfare wretches. All we ask is that we have the same consideration that we seek to provide in the areas of corn, wheat, cotton."

Corn-state legislators read that message loud and clear. Sugar supports, which set a floor under market prices, also tend to set price levels for the growing amd highly profitable corn-sweetener industry, which continues to eat away at sugar's food processing market.

Said Sen. Robert J. Dole (R-Kan.), urging defeat of Quayle-Tsongas:

"What we are about here is passing a farm bill," he said. "I oppose the amendment...the government can make money with this program, with its duties and fees. I want a farm bill. The president will veto a bill if it doesn't meet budget needs. Sugar doesn't violate this."