The very first two things I usually think when I see purple stems is over-watering or magnesium deficiency.
Over-watering can cause a magnesium and related deficiencies. Stopping the over watering will usually remedy the situation. Adding some epsom salts or a calcium/magnesium supplement will usually help, especially if it is from a deficiency in the soil or feeding program. Some strains like blueberry and purple haze or other “blue” or “purple” strains will show these colors in the stems more readily than other, especially during flowering and some purple in the leaf stems is nothing to worry about. Also cold temperatures can bring out purple in the plant tissues.