True, but one difference is that the market for carpentry talent is local. So, a company that is supporting a union in city X has a reasonable expectation of benefiting from its training.
With remote work, computer science is much more global, so someone could easily be trained by a union and then go work for a company that doesn't support the union.
Interestingly, this is one of my Dad's main complaints about unions these days: That our city trains great carpenters, but then they are recruited away to non-union areas.