Why do Muslims take off their shoes before entering a mosque?

In Exodus, when God speaks out of the burning bush he tells Moses to take off his shoes because he’s standing on holy ground.* Is this the source of the Islamic prohibition on wearing shoes in the mosque?
*Curiously, I don’t recall that coming up again anywhere in the OT. E.g., I don’t think the priests had to go barefoot in the Jerusalem Temple.

I’d’ve thought early on it was the simple practicality, transformed eventually into tradition, of not tracking dirt and camel dung into the mosque.

Yeah, it’s pretty much the standard throughout the east and far east to take shoes off when entering a house. Since it would be disrespectful to enter a house with shoes on, it would be double direspectful to do it in a mosque.

Shoes are also taken off in Hindu temples and Sikh gurwaras.

Yo, they put their faces on the carpet.

I believe you’re mistaken. The Kohainim wore linen robes and no shoes.

Seems like a common sense thing to do if you are regularly going to spending time on the floor, etc.

Among Oriental Orthodox (Copts, Ethiopians, Syrians, Armenians, etc.) anybody who serves in the altar must remove their shoes, and the clergy wear special knitted slippers while serving. In former times, everybody removed their shoes when entering the church, and people still remove them for taking communion.

In the Roman rite, as well, bishops have the option of wearing silk socks and slippers while serving mass, a remnant of the time when removing of shoes was mandatory for entering church.