Hydrogen has long been held out as a clean burning fuel that could be used as an alternative to oil-based fossil fuels – both for ecological reasons and in recognition of the finite remaining supplies of fossil fuels. Advocates for hydrogen powered vehicles have pointed to the hyper-abundance of hydrogen in nature and the fact that a vehicle running on hydrogen would only produce water as the output of its combustion process. No CO2, no other nitrogen or sulfur products, just pure water.
All of these claims were and still are true. But, unfortunately the advocates of using hydrogen as a fuel failed to think the process all the way through. There are two downsides to hydrogen powered vehicles.
The first downside is that you need a much bigger gas tank to hold hydrogen than you need to hold an oil-based fuel such as petrol or diesel (or, as an alternate, you get appreciably less range from the same sized tank if it holds hydrogen). This is disappointing, but far from a fatal flaw.
Alas, the second downside is almost certainly a fatal flaw. Although it is true that hydrogen is abundant in nature, it is not readily found in its 'pure' form, but rather is 'trapped' in other molecules, and the cost of 'refining' hydrogen is very high. Most commonly, hydrogen is currently obtained from natural gas or coal, a process that is both costly in terms of energy and which requires a fossil fuel raw material to start with.
Hydrogen can also be obtained from splitting H2O (ie ordinary water) into its constituent hydrogen and oxygen atoms, through the simple process of electrolysis. Unfortunately, this too requires a significant amount of electrical energy, and where does much of the world's energy come from at present? Yes, from burning oil based fuels.
In other words, hydrogen burning vehicles merely shift their pollution, they do not eliminate it, and they still consume fossil fuels (again in a shifted indirect form).
Unsurprisingly, it is much more efficient to bypass all the middle steps, and to simply use an oil-based fuel as the prime power source for vehicles. If the world were to discover or develop a new clean green limitless way of generating electricity, this would change (as would so much else in the rest of our lives!), but until such time as nuclear fission power becomes more acceptable to the eco-lobby and/or until such time as nuclear fusion power becomes feasible, there seems little chance of this occurring.
You might wonder how it is that such a significant and substantial downside to using hydrogen was not considered earlier? Strangely, it seems that advocates were very enthusiastic about hydrogen as an alternative fuel until such time as the government research subsidies ran out.
Here is an article discussing the demise of hydrogen as an alternative fuel in the context of aviation. The same downsides apply with equal force to hydrogen as an alternative fuel for all other types of vehicle.