To is a preposition which begins a prepositional phrase or an infinitive.
Too is an adverb meaning "excessively" or "also."
Two is a number. Many other words in English which reflect the number two are spelled with tw: twin, twice, between, tweezers, etc.
Examples: We went to a baseball game. (Preposition)
We like to watch a good ball game. (Infinitive)
We ate too much. (Meaning "excessively")
I like baseball, too. (Meaning "also")
Six divided by three is two. (Number)
They own two Brittany spaniels. (Number)