Back in the old days, Cathay Pacific used to buy second hand aircraft and overhaul them because engineering in Hong Kong was cheap, they effectively got a new aircraft at a discounted price.
Freight aircraft generally have lower utilisation than passenger ones so ground time can be used for maintenance. Whilst fuel consumption may be higher, the much lower purchase price can offset this and lower flying hours reduces the total fuel bill. A B727 carries roughly the same as an A320 but burns twice as much fuel. When oil prices are low like they have been until quite recently, older aircraft get a stay of execution, once the price heads north again modern replacements make more sense.
For specialist roles such as engine test platforms and fire bombing, where utilisation is very low, an obsolete aircraft such as a B747SP or DC10 costing a few hundred thousand dollars is ideal as the higher fuel burn over the few hours it spends airborne is insignificant compared to the millions that would be tied up in a new model.