THE WINDFALL oil tax bill left the House healthy and overconfident last summer, but then fell on evil times in the Senate. For tax bills, the Senate Finance Committee is the ogre's castle. There this unfortunate bill was imprisioned, starved, weakened, and came within a hairsbreadth of being ritually dismembered. But after a long convalescence in a Senate-House conference, it now emerges in pretty good shape -- in fact, in remarkably good shape.

The oil industry objects to the term "windfall." A year ago a barrel of newly discovered oil sold for a controlled price of $12.66. Today a barrel of newly discovered oil, now decontrolled, goes for about $36. Under the emaciated Senate version of the bill, the windfall tax on that $36 would have been $1.46. In the conference's version, it would be a much more satisfactory $5.84. Oil from older wells would be taxed at higher rates, but that oil is being rapidly depleted and, for the future, it will be the tax on new oil that counts.

There are two reasons for putting a substantial tax on this price increase that, like most other people who speak English, we shall continue to call a windfall. The first is simply equity. Decontrol of oil prices is urgently necessary as a matter of national policy, to cut the perilously high levels of imports.But as consumers pay these sharply higher prices, they are at least entitled to know that some of the increase is being recaptured by the Treasury in their behalf.

The other reason for this tax is to provide a measure of protection to the rest of the American economy and to the balance of competition among industries. Decontrol means that oil producers will soon be taking in vastly more money than they can usefully spend on oil exploration. Some of this flood of money will obviously go into other enterprises run by oil companies, ranging from coal to chemicals to electrical machinery. For the other companies in those fields -- those that do not have oil wells -- the competitive implications of this enormous shift of wealth are ominous.

The conference made two improvements that deserve special applause. The Senate bill would have given a total exemption to what it laughingly called the small producer -- one whose revenues are less than $10 million a year. The conference's compromise gives the independents a lighter race on oil from the older wells but, fortunately, no concessions on the crucial rate on the newly discovered oil.

And, unlike President Carter's original draft, the conference's bill does not tie up the revenues from the tax in a special trust fund. Trust funds and earmarked revenues are bad in principle. This one would have been especially dangerous because the revenues will depend on oil prices and are utterly unpredictable. The amounts of money to be spent on synthetic fuels, or mass transit, are best determined in annual congressional review like any other appropriation -- and not by automatic trust fund formulas.

If the conference bill had looked anything like the Senate version, Mr. Carter would have had a clear duty to veto it. But three months in conference have greatly restored its strength and its integrity. This bill is one that the president can sign with satisfaction.