In the first place, what are called homonyms often aren't. For (your) example, to is only homonymous with too and two when it's unnaturally stressed— ordinarily it's /tə/, not /tu/. Others are homonymous only in certain dialects: merry, marry and Mary are often cited as homonyms, but they have distinct pronunciations in my native speech.
More importantly, there are few homonyms which cannot be distinguished in context. Many belong to different word classes. Again, your example lists a preposition, a quantifier and an adverb; they're going to play entirely distinct syntactic roles. And even homonyms which belong to the same word class will usually be used in contrasting semantic or pragmatic domains—how likely are you to encounter an utterance in which balled and bawled could possibly be confused? Such contextual distinctiveness is far more important than mere phonic similarity; in Real Life, as opposed to dictionaries and taxonomies, phonic phenomena only phenomenate in discourse contexts. In evolutionary terms, these synonyms inhabit different ecological niches, so they do not compete for lexical resources.