In Europe we do just fine with them.
1. Non-union shops aren't meritocracies. The most "meritous" employees are also the kinds of employees that will work for table scraps and the "privilege" of doing what they do. Those folk make up the lower half of any org's tree. That's just good economics, try to argue otherwise to your shareholders and you'll get laughed out pretty quickly.
It's the folk whose main motivation is their paycheck and/or the power trip they get from pushing around folk who make up the upper half. There are just far too many obstacles and disinsentives to climb that ladder barring those motivations.
2. Everyone wants a meritocracy until they get one. Meritocracies make for terrible work environments for 90% of people in the org. It becomes a tyranny of those willing to perform metrics-hacking or win the "sleeping-at-work" olympics.
I'm not saying unions don't have their problems, but the idea that they are bad because they eliminate some intrinsically good meritocray that inevitably forms in their absence is among the worst arguments you can make imho.
Surely that's not a law of physics, you can have unions without automatic promotions, which I agree are not good, usually.
Unions don't have to give special benefits based on tenure either. The industries where that is a a feature of unions happen to be places where it makes sense, i.e. without significant benefits for tenure nobody would ever work for somebody like UPS in the first place because you would be destroying your body for no long term payoff and not making any more money in the short term vs. easier positions that are just as easy to get. A company like UPS, if it were to crack down on unions in an attempt to enforce a "meritocracy", would very quickly cease to exist.
In the context of software development, a union would probably be much more recognizable if branded as a kind of professional association. We all know the kinds of security concerns and awful code that get pushed out because of a poor definition of "merit" on the part of companies. Unions are primarily a way for people that are most able to determine what is meritorious to actually have some influence on the definition of merit in their organization.