The tetanospasmin is a neurotoxin synthesised by some strains of C. tetani. It is the factor causing tetanus, but what is its role for the bacteria itself?
I do not believe the main objective of C. tetani is to harm people. I believe that any organism that wastes resources for purposes not related to its reproduction or preservation is being wiped out by the evolution.
As tetanospasmin is encoded by a plasmid gene, it should be pretty easy ro get rid of and there are strains of C. tetani lacking the gene. As protein synthesis costs resourcess, I guess there is some advantage from the neurotoxin synthesis - otherwise it would be a searious handicap, leading to competitive exclusion of tetanospasmin positive strains.