Headed toward final passage of a new farm bill, the House yesterday sided with the Reagan administration and agribusiness by rejecting a controversial proposal that would have allowed farmers to vote to limit grain production.

The 251-to-174 vote to strike the farmer referendum provision from the bill represented the first time during debate that the chamber turned against its Agriculture Committee and the first administration victory on a key amendment.

But the administration took it on the chin on several other major issues yesterday:

*By 228 to 195, the House defeated an administration-backed amendment by Rep. Stan Lundine (D-N.Y.) that would have lowered price-support levels set by the committee for the peanut program.

*On a 245-to-179 vote reflecting the influence of the maritime industry, a farm-bloc bid to exempt agricultural export credit programs from the so-called cargo preference law was defeated. The law requires that at least half of government-generated grain sales move on U.S. flag vessels.

*Rep. Silvio O. Conte (R-Mass.), attempting to kill the honey-support program that cost the government more than $100 million last year, was ruled out of order on a technicality. The administration wanted the committee's continuation of the honey program stopped.

The main issue -- before the House stopped debate last night and agreed to resume Monday -- was the fight over the farmer referendum, however. Administration sources had termed it the most objectionable feature in the committee's hold-the-line five-year farm bill.

The amendment to kill the referendum was sponsored by Rep. Edward R. Madigan (Ill.), ranking GOP member of the committee, who argued along with others that a referendum leading to production controls would create more problems than it solved.

Removal of the referendum provision left the bill with language that would scale down price-support loan levels on major crops, while freezing income-support subsidies for farmers at current levels next year and strictly limiting future reductions.

The committee bill, with language by Rep. Berkley W. Bedell (D-Iowa), called for a referendum among wheat and feed grain farmers on cutting production as a means of boosting domestic prices and reducing surpluses.

Farmers who did not take part in the program would have been allowed to grow grain only for export or for use on their own farms.

Bedell and his allies, mostly from the economically troubled Midwest grain-producing areas, maintained that the only way for farmers to get the higher prices that many need to stay in business was through production controls.

But livestock producers facing higher feed costs, food processors facing higher raw materials prices and farm suppliers fearing reduced sales from production cuts ganged up against the Bedell plan.

Agriculture Secretary John R. Block, who earlier had warned that any bill containing the referendum would be vetoed, praised the vote as "the first real indication that Congress is serious about getting good, responsible farm legislation."

Bedell, however, said, "I don't believe we can have the middle part of our country collapse and not have it affect all of the country. If the rest of the country gets into the shape we're in, sooner or later we're going to see more willingness to look at alternatives."

The debate over cargo preference was nearly as heated as the referendum battle.

It pitted coastal-state and maritime industry interests, defending U.S. shippers, against agricultural supporters seeking to increase grain exports at the lowest possible cost.