The main reason is conservation. In areas where elephant hunting is not allowed, the native people kill them off because they destroy their crops, resulting in starvation. They are also very aggressive and kill people every day in Africa. In areas where hunting is allowed, the sport hunter is paying anywhere between $10K for a tuskless cow, upwards of $200K for a 100lb(per tusk) bull. All of the sudden the villagers figure out its worth it to allow them to coexist, and can afford to not get themselves killed trying to run off a nasty bull elephant in the midle of the night who is eating their crop.
In countries allowing hunting, they are flourishing, and numbers are increasing, In the countries where hunting for them is not allowed, their numbers and habitat are decreasing.
Keep in mind hunting for an elephant is days and days of walking following tracks, and far from guaranteed. Success rate depends on the area, but you can spend a two week safari walking through a concession the size of New Jersey and never catch up to a good bull.