It has roots in community taboos. In a lot of societies women were forbidden from doing or associating with things during that time. Even the Jews (Leviticus 15.19-33) have rules/taboos about menses.
Do not forget that in a lot of places where there are rivers villagers go to bathe, then carry water home. The thought of a woman mixing her blood with the water people will drink is repugnant.