Earlier quoted context omitted.
> all software engineers there had to be part of the union. Is that legal? Can unions or companies force you to join the union as a condition of employment?
Of course they can - unless you live in a jurisdiction with a so-called “right to work” statute. If you weren’t forced to join then, in theory, management could subvert and then break the union by hiring lots of new employees who are compensated to “opt-out”.
Unions are a tool, not a goal.