This has always struck me as dumb, as until recently it was far cheaper to use your existing (gas-fired) hot water than to use a resistive element. However, with gas going out of fashion (and already hugely expensive in the Eastern states), and abundant solar PV, the calculus has changed.
The problem is that the first few litres of the water coming from the hot water pipe may be cold or warm. Therefore adding a resistive element is a better solution to guarantee a specific temperature.
Gas (especially just in time) still works well for water heating even if you can use heat pumps for everything else. No sure when that will flip, I assume it will eventually.
Gas is already outlawed for new builds in Victoria, despite vast gas resources in the Bass Strait. Presumably that's the direction other states are heading too.
It was a direction some states in the USA were heading before Trump, but now… anyways there will come an economic/technological point where electricity just makes more sense like it does for almost everything else. No need to legislate a transition when one will happen naturally, but we aren’t there yet.