It costs more to distill a gallon of ethanol than to produce a gallon of gasoline. Some sources say that it takes more energy to produce a gallon of ethanol than you recover when you burn it. It makes no economic sense for the oil companies to put it in gasoline.
Except, if the oil companies add a little bit of expensive ethanol to their gasoline, they avoid a big chunk of the gas tax they would otherwise pay to the federal government. Adding a little ethanol saves more in taxes than the cost of the ethanol. NOW, it makes economic sense for the oil companies to add it.
As I recall, at the time it was enacted this incentive to add ethanol was more about American “energy independence” from OPEC than from any environmental concern. It was an easy sell to Congress because it had the backing of the very powerful farm lobby.
Wayne