Well, think about (a) how you get puncture wounds, and (b) where rusty nails tend to be. You (generally) get punctures by stepping on things, although if you were thrown against a barn wall you might get punctured by a siding-nail that missed its mark (this doesn't happen in houses because there are walls of some kind on the inner side of the framing). And where do nails tend to be rusty? Where they're wet, which means, by and large, on the ground. And if you go back a century or two, when there was lots of cow-dung and horse-dung, etc., on the ground, not to mention horseshoe nails, the potential for getting tetanus from a rusty-nail puncture seems very real. Hence the "rusty nails give tetanus" pitch.