If you had been over flying Africa, the reason would have been because ATC is not always awake and other a/c not always in full communication with everyone else.
My guess, as a pax, is that flight crew want to make sure that they are seen by everyone else and are clearly identified as a passenger airliner.