I'm all for taxing consumption rather than production, but one has to be very realistic about how much of this can be achieved in practice. Probably a large part of the reason why it is customary to get most tax revenues from production (income) is because it is simple. When taxing consumption with externalities playing a large role, the complexities quickly start to mount.
For gasoline, some of these complexities have already been named. For example, it is obvious that congestion and accident externalities vary greatly from one region to another, implying that a fair system would track exactly where everyone has been driving in order to put a fair number on the tax return. Naturally, this is not possible.
Many other examples of externalities related to various types of consumption can be named. One interesting example is the health effects related to excessive consumption of various unhealthy foodstuffs. The USA now spends 1 in every 5 dollars turned over in the economy on health care - a truly stupendous amount of money - and achieves one of the lowest life expectancies in the developed world. Much (if not most) of this massive expenditure can technically be avoided via healthier consumption habits (e.g. Japan's healthcare expenditure relative to GDP is half that of the US and their average life expectancy is a full 5 years longer).
The potential postive economic impact of fixing this externality dwarfs that which could be achieved via gasoline taxes, but this will not happen due to a long list of rather obvious complexities related to this form of taxation.
Overall, my view is that it is not really worth it to try and internalize short-term local externalities like congestion and air pollution. The people who experience the negative effects of these externalities (the same people who benefit from causing them) will demand change before the costs begin to excessively outweigh the benefits. The thing that needs to be taxed is long-term global externalities (where those who cause negative externalities can be separated from those who experience them by thousands of miles and tens of years). The most obvious example of this is CO2, but other even more politically sensitive examples can be named like the excessive fertility described by Bill below and excessive self-destructive consumption as in the above example.