Answered by Shaykh Faraz Rabbani
Concerning the answers to whether women should attend the masjid for congregational prayers or not: If the female is not married, then is it alright for her to attend the congregational prayers such as Jumu’ah, tarawee, or the daily prayers. Also, even if the female is married, if attending the masjid to pray the congregational prayers does not interrupt her moral responsibilities in the house, then is it permitted to attend the prayers in the masjid?
The ruling is that it is disliked for women, whether married or single, to go to the mosque to pray, as the Lawgiver has explained that their ‘optimal’ prayer is at home. However, if they go for another acceptable reason, in a manner that does not lead to the non-fulfillment of other duties or in an inappropriate way, this would be permitted, or in some cases even rewarded.
Actions are by intentions, when the means taken are sound.