It could be a cosmetic thing (which isn't necessarily bad), but the "good" reason for doing this is to renew the insulation on the alternator windings. The stator of the alternator is made up of three coils of densely wound wires with a relatively thin coating of insulation (which allows the wires to be closely packed making for a smaller, higher output, alternator).
If the insulation is mostly intact then recoating the coils can help to extend the life of the alternator (or motor, same principles apply). A common brand is Glyptal which is a brick red color.