First, visiting a temple is quite different from visiting any other place. Cleanliness is as essential as preserving sanctity. Shoes move on various surfaces both dirty and clean. This cleanliness is of prime necessity to preserve the sanctity of the temple, which is the holy home of God. Temple is a home of GOD, we must maintain the cleanliness.
Moreover when we go to a temple or approach the holy temple altar at home, our mental state and status should be quite different. If we take off the shoes or other footwear, together with all our mental darkness, ego and crookedness and then if we enter the temple and approach God, the receptive capacity of the mind would increase. It will be highly beneficial for us if we keep out the bundle of worldly thoughts together with our shoes or footwear outside and then practice meditation and devotion. For realizing God we need to keep our egos outside.
In Vedic culture it was not permissible to set foot in a room without first removing one’s shoes, to removing shoes at the front door is a mark of respect to the house and to honor its cleanliness and purity, taking off one’s shoes at the front door can be a deeply ingrained cultural habit.
Removing shoes outside a temple is a gesture of being both symbol and a conscious desire to leave behind the outer world by shedding, literally, the first obvious steps—shoes.