Why does Tails on Sonic have two tails?

Tails has two tails simply because he was born that way. His two tails enable him to fly.
Also, in Japan, foxes with more than one tail are considered very lucky. If you see one, it is said that you will have good luck for the rest of your life. This is also why Vulpix and Ninetales (two fox-like Pokemon) have more than one tail.