I think it's a whole mess of things - outdated misconceptions about unions, overestimating their own abilities, being oblivious to the efforts of employers to commoditize the profession and/or play labor against itself.
I was a member of a union which included developers for a while and it wasn't close to a bad deal for anyone short of perhaps the top 0.5-1% and even that was arguable.
One of the brightest guys, who I know quite well, was endlessly dissatisfied with his not-too-shabby top-end union rate and left seeking more.
Today, not only is he paid notably less (though still comfortably over 100k) has endured layoffs and of course lost the 457, 401 + matching, 5 weeks annual vacation, fast accruing sick leave, 1.5x on-call rate and health plan. In the same period he'd have seen 2 guaranteed longevity increases from the union plus across the board bumps from a revised CBA.
Developers will keep thinking they're all 10xers who'll see their rates quartered by unions until a16z has its way and software development truly is a 'low-skill trade', 'decoupled from ability and experience'  and it's too late.