'The Messenger of Allah (ﷺ) said: Do not prevent the maid-servants of Allah from going to the mosque.

Sahih Muslim Book 4, Hadith 152