This harked back to the original reason labor unions formed in the 19th century (as confessional entities), to maintain medieval traditions of integrating work and life along with the justwage.
Forcible interventions into immigration were really just forcible interventions into the labor market designed to restrict wage competition, just like unionism, just like mandated 30-hour work weeks or forced retirement or wage floors.