Usually it is to avoid paying overflight fees. There is very little cooperation or communication between African states. A (say) Guinean operator who wants to fly to (say) Equatorial Guinea would have to fly across several small African states, most of them using English rather than French. The work involved in getting overflight agreements is substantial and the chances of getting it in a reasonable time frame nil. So easier just to fly with the transponder off and not talk to anybody on the radio, and saves money. That's a win-win by African logic.