"There is a single light of science, and to brighten it anywhere is to brighten it everywhere." -- attributed to Isaac Asimov
It doesn't matter much that Asimov probably didn't ever actually say that, because it is true -- it's true of science, and it's true of education more generally: it benefits everyone for anyone to be educated.
It benefits me, and everyone, to live in a well-educated society: I want everyone to get enough education to have an intellectual conversation with, to understand public good enough to e.g. get vaccinated against common diseases (barring genuine medical reasons not to), to (if they choose) advance science, technology, art, or literature to make life better for everyone.
Educating any person directly benefits me in a way that, say, healing, housing, or feeding a person does not. Healing, housing, and feeding everybody are, of course, objective goods; but educating everybody is both an objective good and a subjective good. It benefits a hypothetical me (in a Rawlsian veil-of-ignorance sort of way) for everyone to be healed, housed, and fed; it benefits actual, literal me for everyone to be educated. If I were a purely selfish person, I would still want to teach.
It may benefit me more for my neighbor in Buffalo to be educated than it does for my neighbor in, say, Lagos to be educated, but both benefit me. I'm not competing to make my students better than students in Lagos, I'm trying to make my students better than they were yesterday.
Education is not a race to the top, it's the proverbial rising tide that lifts all boats. If it were a race, it would be a race against the Blob -- I want to escape the Blob, but I also want you to escape the Blob, because if it eats you it becomes bigger and stronger and more of a threat to me.