It's "efficient" from the perspective of oil producers to
burn off natural gas coming from their oil wells because it would cost more to set up the infrastructure to use the gas than they expect to get from producing and selling the gas. Some believe it can be economic to capture the gas and are setting up facilities, but for now, burning it is the way to go. If the true costs of this were imposed on the producers, no doubt they'd change their tune, but until the externalities get internalized, it's efficient to be wasteful.