The Prophet ﷺ said, "Allow women to go to the mosques at night."A son of his said, "By Allah, we will not allow them, for they will take it as a means of corruption. By Allah, we will not allow them."He rebuked him and grew angry, saying, "I tell you that the Messenger of Allah ﷺ said, 'Allow them,' and you say, 'We will not allow them'?"
حدثنا عثمان بن أبي شيبة حدثنا جرير وأبو معاوية عن الأعمش عن مجاهد قال
قال النبي ﷺ ائذنوا للنساء إلى المساجد بالليل فقال ابن له والله لا نأذن لهن فيتخذنه دغلا والله لا نأذن لهن قال فسبه وغضب وقال أقول قال رسول الله ﷺ ائذنوا لهن وتقول لا نأذن لهن
Reported by Muslim, Prayer, chapter on women going out to mosques when it does not lead to temptation... Amash, etc., no. 442, from the hadith of Abu Muawiya through him. Bukhari mentioned it as a suspended chain, no. 865, from the hadith of Shuba, from Mujahid, through him.