Why are non-Mormons not allowed or prohibited from entering the temple?
Mormons have two different types of buildings that they use in their worship of Jesus Christ. The most common is a church, where anyone is welcome to attend any of the meetings. Churches are used for regular Sunday worship, and meetings are held at various times throughout the world. The second building is the temple. These are not used for Sunday services, so you will not find someone giving a sermon there. They serve a different purpose and are closed on Sunday.
To Latter-day Saints, temples are considered houses of God and places of holiness. They are held as one of the most sacred places on earth. They are a quite and peaceful refuge from the world. At a temple dedication, they are dedicated to Christ. Only members who have a current temple recommend are allowed into the temple.
Why is a temple recommend required to enter the temple?
While anyone can attend a church service only members in good standing are allowed to go through the temple after it is dedicated. Latter-day Saints believe that the temple is the house of the Lord. They are dedicated as sacred spaces where latter-day saints can receive specific ordinances they believe are required to return back into the presence of Heavenly Father. Latter-day Saints believe these ordinances were established by commandment from the Lord and are things that the Lord would not have taken lightly or mocked. In other words, latter-day saints believe that these things are sacred to the Lord.
According to Luke 12:48, "whomsoever much is given, of him shall be much required." Latter-day Saints also believe that those who go through the temple may be held more accountable than those who have not. Accordingly, the man who has gone through the temple and then breaks the commandments without the desire to repent can be under greater condemnation than the man who has broken the same commandments without the desire to repent, but has not been through the temple. Christ Himself is the only one who has the right to determine this. This is why it is important to the LDS church that only those who have shown that they have a testimony in the principles of the Church of Jesus Christ of Latter-day Saints are allowed to partake in the ordinances of the temple.
Why is a testimony required? Because in the temple, members make promises to live righteously and follow the requirements of the gospel. Imagine if God, whether the Mormon faith was true or not, actually held you accountable for the promises that you made to Him. If you went through the temple and promised to live righteously and live the gospel, you would have to do so to keep your end of that promise. If you broke your promise because you did not have a testimony of the LDS church or of God, you would then have to be held accountable for it. Therefore, in order to keep those who do not believe the teachings of the LDS church from making such promises that they are not ready to make, the church requires that you actually have a testimony before you make them.
Ezekiel addresses this in his statement:
"Thus saith the Lord God; No stranger, uncircumcised in heart, nor uncircumcised in flesh, shall enter into my sanctuary"
While the requirement for a physical circumcision was done away with at the death and resurrection of Christ, the requirement for a circumcised heart was not.
For those who have a testimony of the restored gosepel, the blessings received from the temple are great. We can be sealed to our families forever, continue in education and learning after this life, eventually become joint heirs with Christ to inherit all that our Father has, and eventually learn to be like our Father in Heaven.
For more information on temples
At the bottom of the 'About Mormon temples' page of this site is a list of temple resources including interior pictures, an in-depth look at the ordinances, and the history of the temples.