The CO2 generated by using NG is about half that of coal in generating electricity. We really use very little oil to generate electricity. They use it some in Hawaii for obvious reasons. NG has some clear advantages in electrical generation when used as a peaker plant, which we'd need a lot of if we used a lot of solar and wind.
Coal is of course a lot dirtier cradle to grave.
But the point of banning NG appliances in new construction is different than NG vs coal vs oil.
It's that today, we might have a mix in our electrical generation in geographic area X of 25% coal, 30% NG, 40% nuke and 5% renewables.
20 years from now, that balance might be 0% coal, 25% NG, 50% nuke and 25% renewables.
If you install an electric stove in a house, that stove has now seen its CO2 emissions involved in its use drop IMMENSELY over 20 years because the electricity used to power it is cleaner.
But if you install a NG stove in that house, its CO2 emissions involved in its use are the same in 20 years as they are right now. Cleaning up electrical generation has no benefit to the NG stove's emissions.
You can't make a NG stove environmentally cleaner over time, but you CAN make electricity generation cleaner over time, and if the stove is electric, the benefit cascades down.