These two-letter words ending in -o are pronounced with the vowel /oʊ/: bo, go ho, jo, lo, no, so, and yo whereas do and to are pronounced with the vowel /uː/. Is there an explanation for the discrepancy in pronunciation?
The question posed
makes an incorrect presupposition. That's the cause of the problem.
That presupposition is that
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.
Pronunciation of many (probably all) English words has varied over time and from place to place.
As you have noted, spelling is not a foolproof guide to current pronunciation in any specific place. This is particularly true as spelling currently varies from place to place (e.g. color and colour).
We decide how to pronounce a written word in any of the following ways.
The result may be judged correct in some places at some times yet be judged incorrect elsewhere or elsewhen.
The idea of standardised spelling is a relatively modern one. Shakespeare quite happily wrote his name using many different spellings. It was only with the advent of dictionaries that spelling gradually became frozen in whatever choice of letters the dictionary compilers selected. The early compilers do not appear to have been especially concerned about consistency between spelling and pronunciation. Noah Webster was a bit of an exception.
Words that today have similar spellings may have, in the past, had spellings that differed more widely and which reflected different pronunciations. Such words may have originated in different languages and have spellings adopted from those differing languages - which may have had different rules of pronunciation.
So the contradictions you identify might arise from an unfortunate convergence of spelling changes or from a difference in source language or even from an arbitrary change in pronunciation (e.g. in "the great vowel shift").
Because the English language has co-opted words from many languages, and then corrupted/changed them over time we have a variety of pronunciation and spelling rules...which are not inflexible (compare the pronunciation of words by an Essex native with that of a Geordie, for example)
There are general guidelines which do broadly work - as long as you know or can guess the origin of a word. Did it come from a Latin root, or one of the Germanic languages, or Norse etc.?
There are many, many more vowel sounds in English than the five traditional Latin vowels. So it is inevitable that the same letter will represent different sounds in different words.
At best, English spelling reflects Middle English pronunciation, not Modern English pronunciation. That means it was locked in before the Great Vowel Shift.
These two simple observations go most of the way towards explaining your mystery.