This is a thorny issue, and lots of poskim have dealt with the issue of havarot (pronunciation systems for Hebrew) -- you can see a nice summary here. I think the most lucid summary of the situation is given by Rav Moshe Feinstein in Igros Moshe OC 3:5. He explains that it's true that Hebrew had an original havara (pronunciation) that all the modern havarot evolved from, but any havara which is used by a community is called "leshon hakodesh" for halachic purposes. His proof is from the fact that Ashkenazim hold by Halitzot performed by Sefardim and vice versa, despite the fact that the halacha requires the one performing Halitzah to be able to say the associated text in leshon hakodesh. He doesn't deal with the Shema explicitly, but it's implied that if a person pronounces it correctly according to his own havara, then for him that would be called pronouncing the Shema correctly. (There are other responsa that deal with the Shema explicitly, e.g. Rav Bentzion Uziel in Shu"t Mishpetei Uziel OC 1.) I believe that this resolves the OP's question of how it was permissible for havarot to change over the generations.
As for how the different havarot arose historically, Rav Moshe says that indeed, they were influenced by the surrounding languages. I can also add from my own studies in linguistics that there is very good evidence for this in many cases, e.g. the vowel shifts in different varieties of Ashkenazi Hebrew are mirrored in the vowel shifts in the varieties of Yiddish spoken by the same Jews.