Which ones? I know a few countries with those qualities, some of them filter out the bad students really early on or into another stream of education (typically slower, lower quality), as in before you're 9, not 20.
Cheap studies don't turn students into mindless debauchery-loving zombies, but they also put a pretty hard cap on the professors' salaries. As long as your school is really a not-for-profit organization, salaries will be mediocre.
Elite American universities can attract top scientific talent from overseas with good salaries and very well equipped labs, because they have the money. This, in turn, attracts foreign students.