Ola had a good comment, worthy of a good reply:
Personally I've worked with and come through labs that churned out 30, 40, 50 trainees in the career arc of the PI. I know for sure I don't want that - it's unsustainable, not to mention ethically problematic. However, at the other end of the scale, since becoming a PI 13 years ago I've trained 3 PhDs so far and have 2 more graduating in the next year. Should I stop at "replacing myself" those 5 times, and just not take any more students until I retire in 15 years? The question: what IS a good (ethical, sustainable) number of PhD trainees that a bioscience PI can reasonably expect to have in their lab' during a typical career? Is 5 too many? How about 25?
To Ola, I say: I don't have a good answer for you.
It's really a tragedy of the commons problem. You and I can limit who we train, but if the Big Labs keep churning them out, will our trainees get lost in the shuffle? Or can we argue that we are K-strategists (as opposed to r-) and that we give more to fewer trainees? (and if you know r/K theory, and want a good chortle, google it and "evolutionary psychology" and read some... well... bizarro interpretations)
For years, I've only taken clinical/PhD students, MDs/DMDs/PTs for whom there is more employment flexibility. But mostly I take only postdocs, with the idea that I can add some value to those people: not just marking time till the get job, but give them additional skills/background/credentials. But if a really good basic science type came along, interested in what I do? That would be a hard call.
People in the comments have complained that postdocs are too expensive. This is true if grad students are subsidized by your department, as many are. And if you have to pay your postdoc a reasonable wage, it will be more so. If students aren't subsidized or postdocs are subsidized, then it comes out closer to the same, throwing tuition in with salary for students.
It is worth remembering that training grants can support postdocs (I was the co-PI on one for years). Many also support residents to do a year of research or a fellowship in the middle of residency. This may align in clinical departments, and people working at the edge of basic/clinical research. If institutions realize that grad student stipend + tuition is in the same ballpark as a PD, then that might begin to change. This is part of the education of the "carpet-people" that needs to happen.
So the answer in part is: you need to do what that with which you are comfortable. You need to remember that your trainees are people, who require that you provide them with not just scientific training, but the professionalism necessary to succeed. You need to be able to sleep at night, knowing that you did what is right even when those around you have no trouble justifying dreadful behavior. And, you need to survive. Just be careful of justifying behavior on the basis of survival. On that path lies madness.