It's also because the bacterium in question is anaerobic, so it dies in an oxygen environment; rusting consumes oxygen, so it helps preserve the bacterium longer out of soil.
Edit: I had always been told this, but evidently it isn't true. The rust does not seem to have any effect on the bacterium that causes tetanus. Apologies for spreading misinformation.