Corrected Sentence:
It's a secret. You mustn't tell anyone.
Explanation: If something is a secret, the intention is that people should not reveal it. "Mustn't" is used for prohibitions, which fits the context of a secret. "Needn't" would imply it's not necessary to tell, but doesn't convey the strong prohibition.