Answered by Shaykh Abdullah Anik Misra
For two years after conquering Makkah, the Prophet (Allah bless him and give him peace) left the door of the Haram Mosque open for non-Muslims to perform Hajj and Umrah. It is not reported that he ever prevented them from drinking Zam Zam water. Currently, the Saudi Arabian government does not allow non-Muslims to enter; doesn’t this go against the teachings of The Prophet (Allah bless him and give him peace)?
In the Name of Allah, Most Merciful and Compassionate
I cannot speak on why the modern-day government of Saudi Arabia chooses to make the decisions it does concerning the Al-Haram al-Sharif on this issue; it could be a mix of taking a particular religious opinion and logistical or practical reasons.
However, regarding the legal rulings, there is a difference of opinion that has been addressed in the two answers below:
[Shaykh] Abdullah Anik Misra
Checked and Approved by Shaykh Abdul-Rahim Reasat
Shaykh Abdullah Anik Misra was born in Toronto, Canada, in 1983. His family hails from India, and he was raised in the Hindu tradition. He embraced Islam in 2001 while at the University of Toronto, from where he completed a Bachelor of Business Administration. He then traveled overseas in 2005 to study the Arabic language and Islamic sciences in Tarim, Yemen, for some time, as well as Darul Uloom in Trinidad, West Indies. He spent 12 years in Amman, Jordan, where he focused on Islamic Law, Theology, Hadith Sciences, Prophetic Biography, and Islamic Spirituality while also working at the Qasid Arabic Institute as Director of Programs. He holds a BA in Islamic Studies (Alimiyya, Darul Uloom) and authorization in the six authentic books of Hadith and is currently pursuing specialized training in issuing Islamic legal verdicts (ifta’). He holds a certificate in Counselling and often works with new Muslims and those struggling with religious OCD. He is an instructor and researcher in Sacred Law and Theology with the SeekersGuidance The Global Islamic Seminary. Currently, He resides in the Greater Toronto Area with his wife and children. His personal interests include Indian history, comparative religion, English singing, and poetry.