When Joshua was near Jericho, he looked up and saw a man standing in front of him holding a drawn sword. Joshua approached him and asked him, “Are you on our side or allied with our enemies?” He answered, “Truly I am the commander of the Lord’s army. Now I have arrived!” Joshua bowed down with his face to the ground and asked, “What does my master want to say to his servant?” The commander of the Lord’s army answered Joshua, “Remove your sandals from your feet, because the place where you stand is holy.” Joshua did so. -- Joshua 5:13-15
What a strange thing to say! I would think the heavenly commander would say something like, "Buck up, grasshopper, because you've got the invisible celestial army here to help!" or "Wait for my signal and then charge!" or "Make a sacrifice to God before you begin your attack!" or something. But he tells him to remove his sandals. In this culture, removing your sandals was a sign of respect, because the sandals were covered in dust, animal droppings, and sweat, and it was better not to track such dirt into a person's home or into a sacred place.
If the place where Joshua stood was holy, wouldn't it go against the idea that the human is the profane, and so it shouldn't touch the holy? Of course, the whole idea of clothing was introduced by humans to cover the shame of nakedness, so maybe the very act of covering our bodies up is the profanity, not our nakedness. In any case, if the clothes separating us from the holy ground are covered in dust, sweat, and animal droppings, they must be removed!
Sandals don't cover a lot of your feet, though: if your sandals are a dirty mess, your feet will be too. It's one thing to remove "dirty clothes" that separate us from the sacred, but what if we ourselves are dirty? Then we need more to become clean so that we can stand in the presence of the holy...
This is an interesting take on this sandal-removal concept:
Shoes are a protective layer and so those with shoes can walk anywhere without paying special attention. But when one is barefoot one must pay attention to where one is walking. A person aware of holiness pays attention, real attention, to where they are going and on what they are treading. -- Rabbi Melanie Aron