Non Muslims are different types;
1. People of Book who are Christians and Jewish etc who have different rules in entering Masjid. The obligatory precaution prevents letting them inside a Masjid.
2. Non Muslims who are not People of Book e.g Mushrik or denying religion etc, are definitely not allowed to enter any Masjid.