The question posed
Why is “go” spelled with the same vowel as “do” and “to” since it is pronounced differently?
makes an incorrect presupposition. That's the cause of the problem.
Deny the presupposition and the problem goes away.
That presupposition is that
English spelling represents English pronunciation.
This is False.
The fact is that the spelling of modern English words does not give more than a vague guide to their pronunciation.
Vowels, especially, are terribly inconsistent, because there are fourteen phonemic vowels in American English (see the list here -- there are even more in other dialects), all represented by only five vowel letters, in many traditional ways, all inconsistent. Each way was designed centuries ago by people who knew no phonetics, spoke many languages and dialects (not all of them English), and thought they were writing Latin.
Any dictionary will tell you the spelling of English words. A good dictionary (which American dictionaries are not, alas) will also give the pronunciation in IPA or Kenyon-Knott. Spelling and pronunciation are separate, and should be learned separately, like the singular and plural forms of German nouns.
So the answer is that go is spelled with the same vowel as do and to because that's how they're spelled. There is no other reason. No matter what your English teacher told you. Sorry; it's not their fault, though -- they were taught this lie, too.