Legislation that would release timber companies from costly contracts they signed during the housing boom of the late 1970s will benefit the industry's largest firms and those least in need of help, opponents said yesterday during a hearing before the Senate subcommittee on public lands.

The contracts for harvesting timber in federally owned forests were obtained through "speculative bidding that forced everyone to pay high prices," said Robert Gates, who said he was testifying on behalf of a small, family-owned sawmill and remanufacturing plant in Nevada.

"This speculation resulted in the disruption of an orderly process in the timber industry, and a bailout for those who caused it will simply guarantee this speculation, and disruption, will continue," he said.

A representative of the National Forest Products Association defended the proposed legislation as "an equitable way out of a complicated situation." Allowing timber companies to abrogate the old contracts and bid on new ones "would have a net beneficial effect. . . . Timber would come back on the market at competitive prices," said the representative, John Hall. Hall's association represents about 2,500 forest industry companies.

Dan Goldie of the Western Forest Industries Association said "a substantial number" of his member companies could be "forced into default" if they are not released from their contracts. Goldie said that a number of his association's members are small companies, and that, "In the timber situation in the West, if a mill defaults, it disappears."

Yesterday's hearing was held to enable Sen. Howard M. Metzenbaum (D-Ohio), ranking minority member of the subcommittee, which is part of the Energy and Natural Resources Committee, to question witnesses.

Metzenbaum, who was unable to attend the first hearing late last month, is a vocal opponent of the bill. "I have trouble with the whole concept of breaking contracts, he said. Proponents say the government " 'can afford it. What the devil. It's only $2 billion,' " he said.

The Congressional Research Service estimates that the government will lose $2 billion if the bill is passed in its present form, according to Doug Lowenstein, an aide to Metzenbaum.

The timber companies of the northwestern states cut much of their timber in federal forests under contracts with the government. In bidding during the late 1970s, lumber companies drove the contract prices up to about $470 per thousand board feet. The housing market collapsed and lumber prices plummeted, however, before the firms could harvest much of the timber. Lumber now is selling at about $228 per thousand board feet.

Metzenbaum plans to offer an amendment to the Senate bill to require companies to prove that they facing serious damage or collapse if they are held to the old contracts. He said that, without the amendment, the major beneficiaries would be the "giants" among the timber companies.