The prominent Muslim scholar and Da`iyah, Zeinab Mustafa, states on this issue:

Some women really need to enter the mosque and attend some classes or even to attend jumu`ah Prayer and benefit from the khutbah. As long as the woman is aware enough to preserve the purity of the place, and she needs to go for the masjid for a valid reason, then it is allowed. However, if the woman is not used to go to the masjid, she should not go while menstruating.