A comment below mentions subsidies - that's certainly part of the answer. In addition, for mobile applications, not all energy sources are equal. Transportability (stability, energy density, etc.) also contribute to liquid hydrocarbon Joules being more valuable than methane, coal or sunshine.