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. No matter what your English teacher told you. Sorry; they were taught this lie, too.
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; and there are even more in other dialects), but they must all be represented by only five vowel letters, in many traditional ways, all inconsistent.
Dictionaries will tell you the spelling. If they're good (which American dictionaries aren't), they'll also give the pronunciation in IPA or Kenyon-Knott. Those are separate and should be learned separately, like the plural of German nouns or the gender of Russian 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.