Why doesn't infection with Clostridium Tetani immunize you?
There is a big difference with tetanus compared with other infections. The amount of toxin that produces tetany is extremely tiny. Even a small infection that the immune system has yet to react to can be lethal.
To produce a long-lasting response against the bacterium would require a lethal number of bacteria.

Vaccination with the toxoid results in antibodies against the toxin, not the bacteria.