I was a card carrying teamster when very young. Seniority rules protected some unproductive members. But the understanding was that the job had to get done so the rest of us picked up the slack. The guys I worked with were not racist. But I doubt they would have supported illegals on the dole.
The problem with unions is they eventually became just like the corporations they opposed. The main concern of the officers became to get re-elected. Short term thinking just like the corporations they opposed. Then they served no purpose.