If grad school has at best a questionable return, how could a postdoc - indentured servitude, slavery - be any better an idea?
In plain English, it's cheap labor. As I understand it, once upon a time in America, somebody reasonably good who got their Ph.D. could move to a faculty position fairly quickly. Not tenured at first of course, but likely tenure track. When we started getting more Ph.D.'s than we needed, they invented the post-doc. String 'em along, get lots of cheap labor, and every once in a while give somebody a faculty position so the rest could dream. But hey, everybody knows we've got a STEM shortage, right?
Back in the 80's the NSF pushed for a big increase in student visas. They noted that it would probably push down the salaries of Ph.D.'s, though I'm sure that wasn't a motivation.
Speaking from my experience in the physical sciences:
Postdocs are not cheap labor, at least by academic standards. Funding schemes vary, but grad students are often free, meaning you only have to dig up money for consumables/materials/etc. Those that aren't free are relatively cheap, again, depending on the system, some can have their salaries (and tuition) paid by being teaching assistants. If you want them to spend more time in the lab, you can pay their (paltry) salaries. They also have scholarships available.
Hiring a postdoc means hiring a "real" employee on a temporary contract. Most universities have fixed pay scales or guidelines, but that is the gross salary for the postdoc. The overhead for a postdoc is comparatively enormous because you have to pay for insurance, pensions, employer tax contributions, etc. In exchange you get someone with a PhD devoting 100% of their effort to your research. They aren't making six figures because their goal is to publish papers, which is best done in an academic lab. Also, the low pay acts as an incentive for them to move on... at least, in theory. Usually, though, if they stay on long enough they become "senior research assistants" or whatever, and move up the pay scale.
Also, it's not like academic pay scales are that great for anyone. Assistant professors make considerably less than their industry counterparts and work considerably more. The traditional ways to make money in academia are to be famous enough that other universities want to poach you and companies will pay you for consulting or to found a spinoff. The rest are stuck with standard pay scales. It's the coaches and administrators that pull down the big bucks. If you're curious, the state of California publishes the salaries of all UC professors.
Keep in mind that most/all of the costs for hiring postdocs are funded from an increasingly small pool of grant money. We're not talking about private companies, we're talking about a professor trying to keep cash flowing into the lab by competing for grants, which means publishing papers, which is best accomplished by postdocs, and so on.
I think--but I'm not at all sure--that the modern postdoc is closer to what we used to call an assistant professor. In the "old" system (which is still in place in much of Europe) assistant professors were literally assistants to a full professor. They would work in a lab for years until the full professor retired, at which point one would be promoted (via associate professor). An assistant professor in that capacity functions just like a modern postdoc. We now use the term assistant professor to mean "tenure-track professor," which is basically a postdoc that has five years to prove themselves capable or be fired (and of course takes on much more responsibility).
BTW I think the entire system is broken, but taking a principled stand will destroy your career. A professor who pays their postdocs 100k a year is at a competitive disadvantage and is likely to miss out on funding as a result. A postdoc who holds out for 100k a year will never be hired. What disturbs/saddens me is the seemingly endless supply of postdocs willing to work wherever, for however long, and for whatever money just to "stay in the game" in the hopes of landing a tenure-track position. There is clearly a supply-demand imbalance there that creates opportunities to abuse hungry postdocs, particularly from countries without robust university systems. I have seen people trying to raise children while moving half-way around the world every two years earning a postdoc salary; no severance, no moving expenses, no permanent contracts.