I mean yeah, using gas to heat homes is dumb. Electrically powered heat pumps seem like the way to go.
Let's not forget that much of the cost of electricity is down to the massive costs involved in its distribution.
We were specifically talking about Europe. And there, lots of people even in relatively wealthy countries like Germany still use gas for heating. The government could definitely be encouraging/subsidizing the use of heat pumps instead.
Obviously the idea is for transitioning where it's economically feasible, not demanding that poor people freeze to death, jesus christ.
and the current price is not the total cost, which should include externalities like this. (yes, electricity generation currently is also mostly a GHG emitting travesty, but not fundamentally, like nat.gas.)