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.