Because batteries suck for any application where weight (ie. energy density) matters. Running long haul semis off batteries is not a super practical thing. Even with consumer cars, there are people for whom hydrogen will be a better fit.
Basically we've been in a world where the happy medium of energy density and efficiency (gasoline) was used for everything. Now we likely need to split those things up into what energy density is more important for, and what energy efficiency is more important for.