A Virginia tax exemption to boost the fledgling gasohol industry is costing the state $30 million a year, far more than the $2 million annual costs expected, legislators were told today.

State Sen. Edward E. Willey (D-Richmond), chairman of the Finance Committee and author of a bill to repeal the exemption, called the tax incentive a staggering loss for Virginia's highway construction fund and a bonanza for corporations that should be cut off.

Ethanol lobbyists charged in a public hearing today that the state used the tax credit to lure their alternative form of energy businesses to Virginia in 1981 but is now threatening to bankrupt them.

The repeal "would completely destroy our industry overnight," said Luke Staengl, a Floyd County producer and president of the Virginia Ethanol Association.

A Senate committee report said the tax exemption has failed to open up significant markets for Virginia grain farmers who had expected to sell to makers of ethanol, a fermented grain alcohol base that is mixed with gasoline and commonly called gasohol.

The report said more than 85 percent of the ethanol is imported from out of state and comes to Virginia producers in a partially refined condition. The revenue loss skyrocketed because agriculture and motor vehicle officials ruled that the tax credit applies to producers who performed only the final phase of ethanol purifying in the state, rather than the full, four-step process envisioned by the legislature.

As a result, out-of-state producers of ethanol have been shipping ethanol into Virginia in sharply rising volume. The tax credit loss rose from $1.1 million in 1982 to $17 million last year and is projected to reach $32.2 million by the end of the 1986 fiscal year in June.

The debate over ethanol credits is a key element in the developing battle over highway funding in Virginia. Willey's controversial package of gasoline tax and titling fees would raise $250 million during the next two years for road construction, but he has failed to get the support of Gov. Gerald L. Baliles.

A state Agriculture Department official, who acknowledged meeting with ethanol lobbyists, strongly backed the ethanol credit now in place but quickly withdrew when Willey questioned his participation in the discussion. Richard M. Bagley, secretary of commerce and resources, later appeared before the committee and said the official had spoken without approval of the administration.

Baliles, trying to avoid a public fight with Willey, has called for a commission to study transportation needs and wants to hold a special legislative session in September to deal with its recommendations.

But it was the ethanol credit today that drew a packed house of lawyers and lobbyists before the Senate Finance Committee, so many that some industry spokesmen did not have time to speak.

Opponents of the ethanol credit, including major oil companies and independent service station operators who don't sell gasoline with the 10 percent ethanol additive, contended today that the state credit of three cents a gallon, plus a federal subsidy, give ethanol producers an unfair advantage.

Lee E. Williams, president of the Virginia Gasoline & Automotive Repair Association, said the subsidy may force more retailers to sell gasohol, a move that would cost the state even more in tax credit losses.

The state subsidy is scheduled to expire in 1992.

Del. Lewis W. Parker Jr. (D-South Hill), a wealthy oil dealer who holds extensive interests in ethanol gasoline, urged the committee to keep the ethanol credit, but said he would avoid voting on the issue if it were to come before the House because, he said, "I do have a full conflict of interest . . . . "