they often come from different languages into English, so the spelling would reflect phonetics in those languages rather than ours. Then pronunciation in English may change, whereas spelling seldom does. For instance, too comes from old Saxon; two came via Germanic but probably from Latin duo - Germans still pronounce the w (the English sound of v) but in English the sound has dropped out though the spelling remains.
"Wr" words such as write, wring, wrest etc, come fae Old English and indicate movement but sound as if they are spelt rite, ring and rest, respectively.
Then, of course there are words that are spelt and sound differently but mean the same thing, such as "chef" and "chief" which both mean "the person in charge" but were imported into English at different times.