The House voted yesterday to expand emergency food assistance to the needy after defeating a restrictive amendment put forward by the cheese industry.

The bill, passed by 389 to 18, would authorize the Agriculture Department to dip into a wide storehouse of government commodities--including corn meal, rice, honey, flour and wheat as well as dairy products--for a two-year program starting Oct. 1 when a stopgap measure is due to expire.

However, the anti-recession measure--one of several the House has passed this year and sent to uncertain futures in the Senate--leaves a good deal of discretion with the Agriculture Department, which has announced plans to cut back distribution of free cheese from a peak of more than 50 million pounds a month to something closer to 25 million pounds.

Speaking for cheese manufacturers on the floor yesterday was Rep. Danny L. Burton (R-Ind.). Citing statistics supplied by the American Cheese Institute, he contended that government giveaways of cheese over the past two years have helped cut commercial sales as much as 6 percent from a pre-1981 peak.

"The cheese industry is losing a tremendous amount of money," Burton protested. He offered an amendment that would have required individuals to obtain government coupons in order to be eligible to pick up the commodities at emergency food centers, soup kitchens and the like.

Burton's amendment was rejected on a voice vote after Rep. Steven Gunderson (R-Wis.), took issue with the idea that free cheese from the Commodity Credit Corp., rather than the recession, is responsible for sagging sales. "Cheese is expensive," Gunderson said. He said sales have dropped "for the same reason there's been a decrease in car sales."

The bill would give emergency feeding centers priority on most available commodities, to be determined each year by the secretary of agriculture, but the program also would allow shipments to schools, child-care centers and feeding facilities for the elderly.

In authorizing the distribution of wheat flour, the bill said that as much as 300,000 metric tons may be taken from the food security wheat reserve because other stocks are expected to be needed for the payment-in-kind farm program. But the reserve, set up in 1980 to meet problems of famine abroad, would have to be replenished.

The cost of the entire measure passed yesterday, which the Reagan administration opposed, was estimated to be $73 million in fiscal 1984, which begins Oct. 1, and $79 million in fiscal 1985, largely for distribution and processing costs.