Well do the math. In a steady-state where the number of academic positions is static, each professor needs to train a single academia-focused PhD student in his entire career. OK, maybe make that 2 to account for attrition. But most professors are churning out far more PhDs looking to enter academia than there can possibly ever be jobs for. Then these highly-skilled and disciplined individuals end up working for peanuts for decades in the hopes of landing a "tenure" job.
I have two close friends, one in their 40's, one around 50, who are in this situation, and I think it's absolutely shameful. Post-doc positions are fixed terms, so every two to three years they have to worry about getting more funding or being without a job. There's no reason someone as highly skilled and disciplined as these two should be 1) paid so low, and 2) worrying how they're going to support their families every few years. It's really like some kind of a cult.
At this point I would honestly never advise anyone to enter academia, unless you're in a field like Computer Science, where industry does a good job competing with universities for PhDs. If you have the chops to get tenure in STEM, you have the chops to be paid more, with better job security, better work/life balance, better career trajectory, better everything, somewhere else.