Natural gas overtook coal as the top fuel for making electricity in the U.S. two years ago. But its brief reign is under assault in some parts of the country.

State regulators, renewable-energy advocates and environmental groups are arguing that some existing and proposed gas plants aren’t needed or should be replaced by renewable energy.

In...