Human societies already have solutions to this problem. There's a proposed explanation for why strict religious groups (like the Amish) survive so well: costly signaling. There are benefits to remaining in the community, so you have to demonstrate adherence to the group by constant, expensive signaling to keep receiving them.
In a union context, that could be anything from dues, to volunteering for shitty work, to community service obligations. Unions don't really exercise the power to expel members though, because it reduces their own leverage.