The reason it happened is believed to be a combination of factors, i.e. increased sweat combined with sticky surface skin cells that lead to blockage of our pores, or the heat combined with friction that activates the P. acnes bacteria. Another possibility is that exercise, heat and sweat lead to the increased in activity of our sebaceous glands (i.e. oil-producing glands located in the deeper layers of our skin, you may want to view the structure of human skin here) that are attached to our hair follicles and are especially prominent on our face and upper back. It is noted that the sebum (i.e. oil) produced by the sebaceous glands is food for the P. acnes bacteria that live at the base of the follicles. Further, the increased food supply will eventually lead to more active P. acnes with the end result of more acne.
The suggested solution is to apply acne treatment medications before our workout and to shower immediately after the workout. The acne that occur is mostly inflammatory type of acne (i.e. a class of acne where the main lesions are papules and pustules but not comedones), hence, topical acne antibiotics are helpful, especially when used along with a topical BP (i.e. short for benzoyl peroxide, a commonly used topical acne antiseptic, which does not induce bacterial resistance). However, we must careful with the leave-on topical BPs because they are known to cause bleaching of fabrics and can ruin our workout clothing. Alternatively, we could try using BP and/or salicylic acid cleansers after the workout.