They flare to quickly burn off excess gases as a safety mechanism rather than anything else. Venting gas into the air would be much worse.

Can't that burning be converted into energy like boiling water to turn a turbine to generate energy? Or not worth the payoff?