You bring up a lot of good points. I think I have worked for 100 places over the years--and most of my placements were from "people knowing me" than a stellar interview. And there were a few times when the employer was looking for any warm body when I walked in the door . . .
I think the danger lies when a nepotism appointment does not work out--and lingers in that field of employment. That is where the resentment comes in.
In "Political Order and Political Decay", Francis Fukuyama takes us through the rise and fall of various civilizations. A rising civilization is based on meritocracy. But eventually patrimonialism (or nepotism) takes over, and the society declines.
Meritocracy may have some inefficiencies, but in the long term, it produces a better society.