Spotting prior to the period can be due to allergic reactions and hormonal adjustments, both of which can be issues when we're cleansing or undergoing stress or adjusting to a new home/workplace. It can also be due to changes in the thickness of the mucus layer of the cervix, which candida or other types of infections may cause.
If it's accompanied by other symptoms like a really difficult period, back pain etc., then there might be endo tissues or cysts involved.