Why? Assuming you're talking about a standard US union and not something like a guild, it would ultimately suppress wages for the top talent to provide job security to the other end of the bell curve.
I have no problem with unions as a concept and if people want to join them that's fine with me.
However, unions in practice enforce mediocrity while also becoming an institution that exists to support itself (aka its leaders) rather than its members once it reaches a large enough size (which is not unique to unions at all).
Unions makes no sense for a top performer in a field where an individual can outperform other workers performing similar tasks by orders of magnitude. Software development is one of those fields.