There are indeed other reasons for side gigs, but the parent question here does seem to be focused on the financial side of things.
I would agree that work-related progress is likely to be more profitable in the long run. IF (and it's a big IF) there is a route at work to more compensation then that is likely the best use of your time.
Of course not all jobs offer that path, and in some organizations it can take a bit of detective work to find out where things pay better, or where more value can be recognized.
I don't know what you mean by 'moderately rich', but I know multiple people who have saved millions of dollars (including myself), some of which who were able to retire early by working for 'someone else' - also none of which are union shops.
Do you really not know that many people have gotten quite rich working for FAANG companies? Do you also not know these people are much richer than union workers?