The words to, too, two sound the same but have different meanings and spellings. Why do to, too, two sound the same even though they are completely different words?
The answer is simple: to, too, two are homophones of the English language.
In front of: stood face to face.
In a direction toward so as to reach: went to the city.
Towards: turned to me.
Reaching as far as: The ocean water was clear all the way to the bottom.
In addition; also: He's coming along too.
More than enough; excessively: She worries too much.
To a regrettable degree: My error was all too apparent.
Very; extremely; immensely: He's only too willing to be of service.
The cardinal number equal to the sum of 1 + 1.
The second in a set or sequence.
Something having two parts, units, or members, especially a playing card, the face of a die, or a domino with two pips.
A two-dollar bill.
Definitions from The American Heritage® Dictionary of the English Language, 4th Edition and Wordnik.
Homophones (literally "same sound") are usually defined as words that share the same pronunciation, regardless of how they are spelled.
If they are spelled the same then they are also homographs (and homonyms); if they are spelled differently then they are also heterographs (literally "different writing").