Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
Some people claim that there should be no partition between men and women in mosques on the basis that such a partition did not exist in the time of the Prophet ﷺ. How do we respond to such people?
After the verses that commanded women to wear the hijab were revealed, women were described as walking in al-Madinah like ‘black crows.’ Since there was no barrier between men and women the Prophet ﷺ said (referring to the prayer): “The best rows for men are the front rows and the worst are the back rows; the best rows for women are the back rows and the worst are the front rows.” The statement of Sayyidah `A’ishah – “Had the Prophet seen what women are doing now, he would have prevented them from coming to the mosque” – is an indication of the understanding which she took from the Prophet, based wholly on modesty. [These three narrations are evidence of the level of modesty prevalent amongst the Companions which meant that partitions were not a necessity. It is obvious that such a level of modesty is absent from society today.]
Partitions are only a means to accomplish the objectives [of preserving modesty and establishing Allah’s worship in the best way]. Women may need to change their clothing to prepare for prayer and if they are able to do so in concealment then this is better. Both men and women love to take advantage of the time they have in the mosque to attain complete humility in front of Allah [and the existence of a partition assists them in this]. If those with experience in secular education have found that segregating students along gender lines is more beneficial to their learning then it only fitting that we do the same in order to accomplish the higher objective of establishing the prayer correctly. Along with this we know that placing a barrier between men and women is not an obligation, and neither is it is prohibited so there is no reason for the issue to cause unnecessary argumentation. We need to remove the barriers that exist between the hearts by showing mercy and respect, having a good opinion of one another and working together to do good.