There is nothing wrong with meritocracy, quite the contrary.
It stems from the enlightenment and the struggle against privileges some people had simply by birth or social class.
The idea is that people should be judged on their merit, not birth or social class.
As an example, the French Declaration of the Rights of Man and of the Citizen of 1789 states:
All the citizens, being equal in the eyes of the law, are equally admissible to all public dignities, places, and employments, according to their capacity and without distinction other than that of their virtues and of their talents.