Why are localities in Blue America banning natural gas?
In Blue America, people use electricity instead of natural gas. In 2019, the movement to ban natural gas service in new buildings began in Berkeley, California, and has since spread to other places, such as New York City. The reason is that CO2 is released when natural gas is burned. The implication that isn't said is that electricity doesn't.
But natural gas combustion is the United States' biggest single source of electricity. In 2021, natural gas was used to power generators that made 38% of the world's electricity. So, the choice isn't between electricity and natural gas right now. Instead, it's between using natural gas directly in the home or as a fuel at a place that makes electricity. It would only make sense to ban the use of natural gas in homes if more people used electricity instead, which would burn less natural gas and release less CO2.
There are three ways that natural gas is used to make electricity. The first one makes steam, which turns a turbine, which turns a generator, which makes electricity. The second one uses natural gas to directly spin a turbine, like a jet engine, which then turns a generator. The third technology, called "combined cycle," is a mix of the first two. It burns natural gas to directly turn a turbine, and it also uses the waste heat to turn water into steam, which then turns another turbine that drives a generator.
The process of making electricity is not perfect. So, the amount of energy in the electricity made by burning natural gas is less than the amount of energy in the natural gas used to make the electricity.  A generator's heat rate is how much energy it takes to make one kilowatt-hour (kWh) of electricity. The amount of heat lost during the process of making electricity is equal to the ratio of the heat content of electricity (3,412 BTUs per kWh) to the heat rate of the generator. In the U.S. in 2021, the heat rates of natural gas in BTUs needed to make one kWh of electricity ranged from 11,068 for turbines to 7,580 for combined cycle. So, less than a third (3412/11068, or 31%) of the heat in natural gas can be used to make electricity with turbines, and 45 percent (3412/7580) can be used with a combined cycle. And in states like California, using solar power to make electricity has the ironic effect of shifting the way natural gas is used to make electricity away from the more efficient combined cycle and toward the less efficient turbines. This is because solar power needs to be turned up quickly at sunset, which isn't possible with combined cycle generation.
When talking about how converting end uses to electricity reduces CO2 emissions, the heat lost when electricity is made must be taken into account. Heat loss is big for traditional electric stoves, dryers, hot water heaters, and heating. The heat content of electricity, which is less than half of the heat content of the natural gas used to make it, limits how much heat can be used in the home. So, a lot more natural gas is used to make electricity than would be used if it were burned in homes for heating and cooking.
Heat pumps are harder to figure out because they use electricity to "move" heat instead of electric resistance to make heat. This means they can make more usable heat than the amount of heat in the electricity they use. For example, if you burn 100,000 BTU of natural gas in an efficient residential furnace (which will make up 41% of all furnace sales in 2021), the house will get 95,000 BTU of heat. If you put 100,000 BTU of electricity into a heat pump, the house will be heated by 200,000 to 300,000 BTU.
So, heat pumps can definitely make up for the heat lost when natural gas is used to make electricity. The Coefficient of Performance (COP) is the ratio of how much heat a heat pump puts out to how much electricity it uses. Since I already figured out how much heat is lost when natural gas is used to make electricity, I can figure out the breakeven COPs. When electricity is made with gas turbines, 69 percent of heat is lost in the process, while only 5 percent is lost in efficient natural gas furnaces in homes. To make up for this heat loss, the COPs would have to be 3.1, which is (1-.05)/(1-.69). When electricity is made with the more efficient combined cycle technology, only 55 percent of the heat is lost in the process. This means that the COPs only need to be 2.1 (i.e., (1-0.05)/(1-0.55)) to break even.
The heating seasonal performance factor (HSPF) is used to measure how well heat pumps heat, and a simple formula can be used to turn HSPF into COP.
 To get an energy star rating for efficiency from the U.S. Department of Energy, the HSPF must be above 8.5 or the COP must be 2.49. So, if natural gas was used to make electricity in a combined cycle, heat pumps with the Energy Star label would break even and make up for the heat lost while the electricity was being made. In 2021, heat pumps sold in the U.S. had to have the required HSPF rating in 39% of cases. 
When you compare electric induction stoves to natural gas stoves, the math is also more complicated. Most of the heat from the electricity used to run induction cooktops—about 84.5 percent—is transferred to the pots and food inside them (Table 4 here). Natural gas, on the other hand, only transfers about a third (31.9%) of the heat it has to the cooking tools and food. The rest just warms up the air. When gas turbines are used to make electricity and 69 percent of the heat is lost in the process, an induction stove with an efficiency of 84.5 percent only heats food with 26 percent of the original heat. When combined cycle generators are used (.45 x.845), 38% of the heat that was available at the start is sent to heat food. So, depending on how natural gas is used to make electricity, induction electric stoves may use slightly more or less natural gas to heat food than burning natural gas directly in the home. And cooking with natural gas is a small part of how much gas a home uses. 
As long as natural gas is used to make electricity, putting a ban on using natural gas in new homes will not reduce CO2 emissions unless very efficient heat pumps are used and combined cycle turbines are used instead of simple gas turbines. Because heat is lost when electricity is made, all other uses of electricity actually cause more pollution. So why are some places in Blue America not letting people use natural gas?
 About 5 percent of energy is lost when electricity is sent from one place to another. About 3% (p.5) of natural gas is used by compressors to make pressure for the transmission and local distribution pipelines to work. These losses are about the same size, so they are not taken into account in this analysis.
 Average COP = Heat transferred/electrical energy provided = (HSPF * 1055.056 Joules/BTU) / (3600 Joules/watt-hour) = 0.29307111 HSPF
 In 2023, the HSPF rating system for heat pumps will be changed to HSPF2, which has lower ratings than the current HSPF ratings (slide 18). All of the math in this report is done with the original HSPF scores.
 It's not often that people keep track of how they use gas in their homes (heating, hot water, clothes dryer, etc.). In 2011, only 5% of the gas used in homes in Maryland was for stoves (56.1/1093.1) Table 3–4