It's more the other way around: the pronunciation is why you put the accent there.
Specifically, all words of more than one syllable have an accent mark on the syllable that gets the stress. (And a couple of words with one syllable do, too -- there, it's just a spelling convention to tell words apart that would otherwise be spelled the same.)
Very friendly to the reader :) You can pronounce written Greek even if you have no idea what it means.
Things such as νόμος / νομός which have the stress on different syllables are spelled differently as well, so you know that the first one is "law" and the second one is "nome, prefecture".
It's as if you could tell "desert" and "desert" apart in English -- "The soldier will desert his company because he doesn't want to go to the desert". Greek would write that "The sóldier will desért his cómpany becaúse he doésn't want to go to the désert".
The word εγώ, having two syllable, must have an accent on one of them -- and the fact that it's on the second syllable shows that the word is accented on the second syllable: it's "e-GHO", not "EH-gho".