I was wondering if you can help me understand why women are not “allowed” in mosques when on their period. Is it based on precaution alone? I find it very disheartening that I am told that the doors of the house of God are closed to me once a month and I would like to understand this better to Insha’Allah improve my faith.

The issue of women not being allowed to stay in the mosque is not based on precaution and it's not specific to women only rather anyone who is either in haydh or junub therefore a man who has not done his ghusl e janabat equally cannot stay in the mosque.

Furthermore the doors of Allah are not closed on anyone in any state and rather it is recommended for a woman in haydh to do wudhu and sit on her prayer mat and do tasbeeh, duas etc.