There are two things that we need to consider in this regard.
1. The prayer is based on the sunnah. The Holy Qur'an only refers to it as a known practice in the society it addresses. We take the details and laws governing the ritual from the sunnah and not the Qur'an. The Prophet (sws) constituted this worship ritual and taught it to the entire generation of the Companions. They practiced it with their consensus and then passed it on to the next generation with consensus as well. This process continued till our day without a break. All the sunan have been taught by the Prophet and communicated to the posterity through this process called ijma and tawatur. The ruling that the menstruating women will not fast and pray is part of the sunnah.
2. The Qur'an itself has referred to menstruation as impurity and required the women to take a bath when they enter purity. This shows that it is impure state when one cannot offer the prayer.