You are confusing people's desire to live in a place with that place's ability to educate them. They are not dependent on each other. The US is a very prosperous nation with a strong sense of justice and freedom. That is what drives those people to come here. There are far more opportunities to succeed here than in most of the world, and people have the freedom to do so.
What about our education system makes you think it's the best, or even well rounded? It's rare for schools to even teach basic things like how to budget, or how to do your taxes. They certainly have no problem pounding things like how the mitochondria is the powerhouse of the cell into your head year after year though.