In the world of government policy, two chief dangers always loom. The first is people with bad intentions using every available means to achieve their malignant goals. The second, more common but no less destructive, is people with the purest of hearts and the most boneheaded of methods.

For an example of the latter, look west, where the California Energy Commission just decreed that starting in 2020, new homes must be equipped with solar panels. Commissioner Andrew McAllister boasted that the rule “will propel the state even further down the road to a low emissions future.”

He has the right idea. With environmental vandals in charge of the federal government, the state’s leaders are justifiably motivated to do what they can to combat climate change.

“We don’t want to do nothing and just sit there and let the climate get worse,” Gov. Jerry Brown said last year. California is at particular risk from global warming, which will inundate low-lying areas of its 840-mile coastline with rising salt water while fostering more droughts and wildfires inland.

Its utilities are already on track to get half their energy from solar and other renewable sources as soon as 2020. The state is also fighting the Environmental Protection Agency’s plan to gut controls on vehicle tailpipe emissions. The energy commission says the solar panels and other requirements will cut a typical new home’s energy consumption by 53 percent — “equivalent to taking 115,000 fossil fuel cars off the road.”

But there are three major flaws in this approach. The first is that it’s a highly inefficient way to expand solar energy. University of California, Berkeley economist Severin Borenstein told the commission that he and the vast majority of energy economists “believe that residential rooftop solar is a much more expensive way to move towards renewable energy than larger solar and wind installations.”

No kidding. The National Renewable Energy Laboratory figures that on a kilowatt-hour basis, electricity from home solar panels costs 2 1/2 times more than electricity from large solar facilities operated by utilities.

The California approach brings to mind Mao Zedong’s call in the 1950s for Chinese peasants to build steel furnaces in their backyards. Many vital tasks are done best on a huge scale, and generating electricity is one of them.

Another drawback is that it will aggravate the state’s most notorious problem — astronomical housing costs. The median home price is now $524,000, in large part because of regulations that make every attempt to put up new housing only slightly less challenging than the Normandy invasion. California has fewer residential units per person than 48 other states. It’s a major reason more people are leaving the state than coming.

The new mandate will be another burden on new home construction and purchase because it is expected to add $10,000 or more to the cost. Not a big bump, percentagewise, but enough to make a difference — particularly at the lower end of the market, where the people least able to cope are found. And the claim that the solar gear will more than pay for itself over the life of a mortgage will be cold comfort to those who can’t qualify for the mortgage.

It’s another bundle of straw on a camel that is already staggering under its load. The state government might as well as developers and contractors, “What part of ‘get lost’ do you not understand?”

Niskanen Center analyst David Bookbinder says, “The big problem in California is transportation emissions.” Last year, the California Air Resources Board noted that in 2015, emissions from producing electricity fell by more than 5 percent. But those from vehicles rose by 3 percent. Focusing on home solar power is akin to attacking obesity by putting marathon runners on a diet.

A steep gasoline tax would be the simplest way to get motorists to drive less and buy cars that burn less gasoline — or electric vehicles. The current excise taxes on gas amount to just 58 cents a gallon, which is not enough to take many gas guzzlers off the road. If anything, the solar mandate will stimulate more driving as higher home prices induce Californians to move farther from their jobs and endure longer commutes.

Environmentalists in California and beyond have good cause to fear and resist the powerful enemies now in charge of federal policy. But they should also guard against the folly of their friends.

Chapman writes for the Chicago Tribune as well as being syndicated columnist.