The issue is not dirt. The issue is presentation. Some restaurants simply do not want to attract the barefoot crowd. And if I was eating in such a restaurant, I would not want to see bare feet. Grocery stores do not want the liability when you step on broken glass after somebody tossed a ketchup bottle or something. Having said that, I go barefoot in the summer whenever practical.