Because in general Europeans believe education is a right (not a product) and thus that the government has a duty towards its citizens to make education as cheap as possible. Now colleges are hardly ever totally "free", but are extremely cheap (will likely always be anywhere from 100e to like 500e per academic year in France if I remember correctly) and scholarships are widely available for people whose parents have lower incomes. State subsidies from the state to universities allow that.
You also have elite universities, "Hautes Ecoles" and what not that are far more expensive. But scholarships exist for those too. In general I woudl say that scholarships are not linked to the fact that you are a good student or not (obviously, it doesn't hurt your case) because the whole point of university on continental Europe is to give a chance to everyone (obviously you need to at least finish HS first).
So saying "
The reason European countries can offer free universities is that only the top students can attend" is wrong. I spent 4 years in university in France and I know damn well it's not only "top students"