Some customs are more than they first appear, and so it is with kicking off one's shoes before entering another's home. These days many explain it to others less familiar with the practice as basic hygiene, not carrying in dirt or whatever else one may have stepped in while outside, in and around one's house. For many, that's truly all it is, and they think nothing more of it.
Yet there was once more to it than simply trying to keep from carrying dirt in, as it was also about preserving the boundaries between worlds. The creation of shelter was not only an act of survival after a time, but an act of sanctification, of endowing a part of the world with the full concentration of one's spirit. This was a space not only of peace from the outside elements, but a place to establish peace within.
Thus it was that many began to remove their shoes before entering buildings, some more circumspect cleansing their feet as well before setting a single foot within. If any serious incidents occurred, one would often look to those that thoughtlessly entered without removing their shoes, as they had desecrated the space in the process.
There was one such incident, almost lost to history thanks to its severity, that few know of, and of those that do, many regard it as another piece of interesting folklore and little else. However...
...The story goes that a group of fools, seemingly determined to be cast out from every village they encountered, would come along to each one as humble, curious travelers wanting to learn the ways of the village and settle down. Each village, wary but willing to welcome travelers so long as they agreed to abide by their ways, allowed them to stay for a time.
Each village, without fail, had its trust and hospitality violated by these fools. They stuck by their word for a short time, just long enough to learn each village's ways enough to violate as many of them as they could in such a manner as to only be exiled, and not executed.
Finally, they came upon one village that they couldn't figure out. No matter what they learned of their ways, none of them seemed to be held to so strongly that they would upset the people enough to run them out. Eventually, the fools began to believe their own story of settling down there, until they found it. The one rule that surely would get them exiled, that would get the village to reveal itself to them.
A simple rule every villager followed closely and taught carefully to their children, to leave their shoes at the threshold before entering a home, an inn, a temple, seemingly any building.
So as a group, they walked through mud, they walked through dung, they walked through the leftover blood and guts of livestock tossed away as it was prepared for meals, and they made their way to the village inn they'd been staying at. The villagers had, of course, seen all of this and warned the innkeeper, and so as they opened the doors to the inn...The innkeeper was nowhere to be seen.
The regular noise of the other tenants was also strangely missing, the whole inn had an unnerving stillness to it. Nevertheless, the fools were so caught up in their scheme they didn't notice anything other than the innkeeper's absence as they stepped through the doorway. Yelling out to the innkeeper, only then did they start to notice the silence, but still they proceeded further inside, meandering about, tracking their gruesome filth about the place as they looked about for anyone else.
Somewhat disappointed, but determined they would get a response once the innkeeper and tenants returned, they went back to their room and decided to wait. As they waited, however, all the filth they tracked in seemed to grow, and concentrated in their room, it grew even faster.
The fools, utterly confused, tried to escape, but the filth jammed up their door, first from the inside and next from the outside. It began with just the mud, then the mud began to feel warmer and the stench grew stronger, and as they were up to their waist in mud and dung, blood began to ooze up from both, then guts started to emerge...
...And in their panic, the fools failed to recognize, it was their own guts, their own blood, their own waste that had begun to fill the room as well. Their bodies rapidly wasting away alongside the whole inn.
Solemnly, many of the villagers watched as the desecrated inn collapsed upon itself in a grotesque heap, and swore to pass on this tale to remind others why they so diligently remove their shoes before stepping inside a building.