To say that "of course this freelance code is garbage, they're paid peanuts" is naive, because it implies that:
a) Well paid engineers always write beautiful code, and the more they get paid the more beautiful it becomes, which obviously isn't true.
b) Badly paid engineers don't care about code quality if they don't get paid for it, which isn't true because open source is a thing.
Reducing everything to economical incentives is, in my opinion, not very useful.
When you do open source, you are the one who has to live with the results. Forever. I think open source proves the point you're arguing against.
Besides, the argument is not that they are paid peanuts, just that they are being paid for other things. The incentives are not lined up for freelancers to give high investment up front to reduce long term maintenance costs. That doesnt mean every freelancer writes crap code, just that on average its not a system that selects for easily maintainable code.