Genetics do matter. Adult intelligence appears to be somewhere between 50 and 80% determined by genetics. Thus we should expect over time in a meritocracy for smart kids to come from the same families. This is compounded by assortative mating by IQ, which has become far more widespread in the last forty years. So things are going to look nepotistic (and they always will be to some extent, see my second point below) when, in fact, this is a natural phenomena.
So, what? Just let the people who lose the genetic lottery rot? No. Instead, we might want to focus on having a more balanced economy where, rather than everyone striving to become part of the elite, a working class person can have a perfectly reasonable life. Jordan Peterson discusses this problem in this video:
https://www.youtube.com/watch?v=fjs2gPa5sD0
Secondly, it is not immoral for parents to make large investments in their own children's lives. This behavior is no doubt somewhat driven by genetics (nearly everything appears to be at least 40% genetic) but it is also a learned behavior. Government programs that replace parental investment have been catastrophic for minorities in the united states: for example 73% of non-hispanic blacks are born out of wedlock. So delegating parental investment in children to the state, in the name of ending nepotism, may have some very detrimental effects that are difficult to predict.
All of this is to add context and suggest a different solution: making middle class non-elite life paths more attractive, not to deny that there is a problem.