Since no answer gives any reference from any scriptures, i am adding my own.
The reason is scriptural injunction. That is, scriptures ask us not to wear shoes where idols are placed.
There are 5 such places where one is prohibited to enter with shoes on. They are:
- The room where the Vedic fire has been established. 2. A cowpen; Goshala or where the cows stay. 3. A place where a Deity is installed, like a temple or a Puja room and a room for the Brahmin. 4. A place for taking meals. 5. The room where one chants the Gayatri.
One should leave off his shoes [before entering] the house in which
the Sacred Fire is deposited, a cow-pen and the presence of a Deity,
or a Brahmana, [and before] taking his meals, or reciting [the
Gayatri]. (61)
[If a person] putting on [his] sandals, goes, from his house, to the
Five Rooms,* a pious king should cut off his two legs. (62)
Angiras Smriti 1.62,63.
However, these rules do not apply for the following special persons:
An Agnihotrin (i.e., who maintains the Sacred Fires), an ascetic, a
S'rotriya, one who has completely-studied the Vedas ; these may go
there with [their] sandals on ; others must be chastised with
punishment. (63)
NOTE: Angirasa Smriti is counted among the 18 major Smritis that we have.