A research study from way back in 1997 found that if people puncture their feet, they are more likely to get infections because of their shoes, because of the puncturing object going through the bacteria-laden medium of the shoe, and injecting the bacteria deep into the foot. The article states:
There was no significant difference in the prevalence of osteomyelitis and soft tissue infection based on footwear (tennis versus other shoes). There were no cases of osteomyelitis among barefoot children… was strongly associated with the wearing of tennis shoes, … None of the barefoot patients in our study had osteomyelitis. …a pseudomonas infection…did not develop in any barefoot patient. These data seem to support the theory that P aeruginosa does not grow on puncture objects, but rather is intimately associated with shoe gear.
Consequently it is safer and healthier to go barefoot.
Read the article: Soft tissue and bone infections from puncture wounds in children.