It is customary, in many countries in the world and in many homes, to remove shoes upon entering a house; for practical purposes. It ensures that no dirt or dust is brought in on the shoes and this is considered to be respectful towards the host/hostess.
Religiously, people remove their shoes as a sign of respect when standing on ground that is believed to be holy e.g. Moses was instructed to remove his sandals when in the presence of God (story of the Burning Bush which was afire but not consumed).
Not only Muslims but Sikhs, Hindus and Buddhists removed their footwear when praying; it is a sign of humility and respect.
Chat with our AI personalities
Muslims are taught to look after hygiene and 'cleanliness' all the time. They have to be "clean" physically, mentally and spiritually. The physical aspects include their bodies, the clothes the wear, the place they sit on and the exact place where they perform their daily prayers.
Before saying a prayer a Muslim has to be free of dirt or najis (referred to here as najis, example remnants of urine, traces of blood/pus, remnants of stools/feces, as well as hadas). They also have to perform the ablution (a symbolic cleaning of ritual parts of the body). The place on which they stand to say their prayer too has to be clean - free of najis or dirt.
As such Muslims have to pray barefooted by taking off their shoes, for fear that the sole of their shoes could have picked up unwanted dirt or najis along the way. As an extension to this Muslims at large also walk around in their house barefooted (with their shoes tucked away in a secluded corner or cupboard), as they need to say their prayer on the floor, normally on a prayer mat, laid on a clean floor surface.
Hence Muslims expect all their visitors to take off their shoes and leave them outside the front door of the house before going into the house barefooted.
Muslims take their shoes off as a respect before their god and also because they are about to stand on holy ground. They believe that as Moses was instructed by god before the burning bush to remove his shoes becuz he was standing on holy ground, so they must do the same.