Can a shul deny access to a non-Jew due to the fact that he/she is not Jewish? Even if the person genuinely has a desire to learn about Judaism and worship Hashem? What are the rights (if any) of a gentile/Noahide or prospective convert with regards to shul access? My question is about halacha and morals (and not about local laws): is it morally justifiable and halachically sanctioned?
It was my understanding that Gentiles were allowed to bring certain sacrifices--kosher of course--to the Holy Temple. Since prayer is, at least in part, a substitution for the korbans, why would a non-Jew not be allowed to pray in a synagogue. Of course there are many practical reasons why they should not be allowed into a synagogue for prayer but the question above assumes a non-Jew who is sincere about learning about Judaism for positive reasons such as converting.
Full disclosure: I am a volunteer member of my very well known Modern Orthodox synagogues Shabbat/Yom Tov security team. A person who is "obviously" not Jewish would not likely gain entry into the building but would certainly be encouraged to contact the office via phone during the work week and ask to speak with the rabbi. My previous synagogue actually allowed a technically non-Jewish man pray. He wanted to honor his Jewish father by reciting Kaddish. The man was in attendance seven days a week saying Kaddish and davening. Our Hasidish rabbi allowed him to prayer. The man was not however counted as part of the minyan.