It's both of those things, but it's also a necessary and useful part of getting to net zero.
1 in particular was strong when Battery EVs were starting off. Don't bother with those early BEVs, just wait till the hydrogen fuel cell vehicles arrive. While fuel cell vehicles are actually cleanera nd greener than ICE, this went on much longer than was credible once it became obvious battery EVs were the winner in personal transport.
2. Oil and gas companies would really like to use blue hydrogen made from oil and gas and store the CO2 byproducts in oil fields. Or at least claim that they will store it. Luckily for everyone, the price crash in renewables means they'll be outcompeted if they try that and most governments have caught on e.g. the IRA stuff that varies support based on how clean the hydrogen production chain is.
But we need it to make fertilizer and other chemicals, and doing so with cheap renewables will save a lot of countries from being relient on fossil fuel providers.