It is well known that women who are menstruating or having postpartum bleeding are exempted from both prayer and fasting. The reasons that such women are exempted from fasting are, first of all, because it is `amrta`bbudi‘ (an act of worship dictated by Allah).
In addition, Islam is the religion of easiness, and it tends to remove the hardship of women who may be weak or in pain from menstruation. Hence the Shari`ah does not add more difficulty to them by imposing fasting on her. Thus, it is an exemption from the Shari`ah to remove hardship.
Responding to the topic, Dr. Muhammad M. M. Abu Laylah, Professor of the Islamic Studies and Comparative Religions at Al-Azhar University, states the following:
When it comes to Islamic rulings pertaining to umur ta`bbudiyyah (acts of worship) acts, we ought not to ask why. Rather, we should demonstrate the slogan of ‘we hear and we obey’.
Part of the logic behind exempting menstruating women from fasting and prayer, I can say that upon the onset of the period the woman becomes very weak and experiences weakness and fatigue in her whole body, and that is why Allah, the Most Merciful, exempts her from fasting and prayer in order not to add to her weakness.