Pagan Arabs...
Pagan Arabs, the ones who were living in Medina in particular, had become, more or less, sociable with the habits of the Jews, and treated menstruous women like the Jews did. They used to keep aloof from their wives when they were in their monthly courses. That very notable difference in those religious notions and the existing custom among their adherents caused that some Muslims posed that question to the Prophet (S) . In answer to their question, this verse was revealed.
Hygienic Concerns during Menstruation "They ask you (O' Muhammad) concerning menstruation. Say: 'It is a hurt..." The Arabic term /mahid/ is an infinitive form which, here, philologically means 'menstruation'. Thus, the meaning of the verse is: O' Muhammad they ask you about menstruation and its injunctions. In answer to that, say 'It is a hurt'. In fact, this phrase states the philosophy of the ordinance of the prohibition of sexually approaching women during their monthly course.
This matter is referred to in the subsequent sentence. Sexual intercourse with women in this state, besides being repugnant, brings forth much harm. This fact has been approved by modern medicine, too, which can be found in concerning medical books. Some of these harms are as follows: 1- At first, preparing a good environment for the increase of venereal microbes (as a result of dropping particles from the mucus of endometrium in the womb during this period).
2- The probability of the increase of venereal diseases, or STD, both in man and woman. 3- Creating a kind of hatred in man. And, however, for more data, the books concerning the hygiene of women should be referred to. "...
so avoid (intercourse with) women during menstruation and do not approach them till they be cleaned...." The beginning phrase of this verse, which enjoins avoidance and prohibits approaching and having intercourse with menstruous women, initially seems similar to the present regulations in the creed of the Jews.
But, regarding to the sentence: 'then you may go unto them as Allah has commanded you', which is upon the permission of sexual intercourse with women after being cleaned from the menstruation, it is recognized that the purpose of avoidance and barring the approaching is only abstention from sexual intercourse during that period. Thus, Islam has paved a moderate path due to the monthly course of women.
And, the method of Islam everywhere is always the middle way; so, it is always aloof from excess and defect.