Ethanol does not appear to be the brightest idea when corn is consistently over $5/bushel, and it's way past that now. However, when ethanol got started, corn was down in the $2-3/bu range, and farmers were happy as heck to have another market, which made their corn worth more.
The idea behind ethanol, however, was not strictly economic. It also focused on energy independence. In other words, not counting on unreliable foreign sources to keep providing us with oil. By creating an ethanol industry, we now have the capability of making at least some of the fuel on which our vehicles run, should there be a problem with the supply of oil. It is certainly not THE answer to energy independence, but it's one aspect of moving us in that direction.