Also, electricity from gas is relatively expensive. Other sources like coal or hydro are cheaper, which lowers the average cost of electricity.
Yes, solar, wind, hydro, nuclear should be cheaper per unit (coal is not usually cheaper than gas in the US)
Getting electricity out of gas is fundamentally harder than getting heat out of it.
[1] https://iwae.com/resources/articles/95-afue-gas-furnace-work...
The best thermal power plants - combined cycle gas turbines - get about 60% efficiency. Most are closer to 45%.
What we can do is either use the excess heat from the gas turbine in district heating (which combined with resistive electrical heat probably approaches the same efficiency as a local gas boiler), or use that electricity to drive a heat pump, which gives a greater than 1x return on heat where you want it. An efficient combined cycle gas turbine driving a heat pump is going to give you more heating than the same gas being burned in a boiler. - 0.5 * 4 = 200% efficient.
You can also get (although they're much less common) gas powered heat pumps (eg propane fridges in RVs). They might have a "primary energy ratio" of 1.5-2, bringing the total system efficiency of a local gas powered heating system back up to pretty close to that of a remote generation + electrical heat pump system. The electrical system has the benefit that you can slot renewables into the mix as well.
We're talking about heat pumps not resistive heat.
A home gas-driven heat pump could be a better option from an efficiency standpoint, but those are not widely available, probably for cost and reliability reasons.
There should be no economic way that a high efficiency turbine produces and distributes electricity to heat homes at a greater than 1:1 ratio compared to storing, pressurizing, and delivering, then burning in irregularly maintained consumer homes.
Likely the error is that gas pipes to the house are subsidized (albeit the electrical likely is too, with heat pumps and induction stoves, the gas lines are unnecessarily redundant)