A PhD is about learning to do research without supervision. It is not only about mastering a particular niche topic. Indeed, even the students that do become professors are likely to eventually move onto topics that they did not study during their PhD. So, even given a near-certainty that one will not be competitive for a faculty position, a PhD is not necessarily a bad investment.
On the other hand, I am unmoved by those who say "spending six years doing something you love is worth it, even if it doesn't lead to anything." Or "I will not be a complete person without a PhD." A PhD is just a qualification (and not the only qualification!) for a research job. So, a PhD may indeed be a bad investment for students without a realistic path toward some kind of job that will benefit from having a PhD.
In such cases, is it immoral to advise these PhD students?
Strictly speaking, morality is outside our area of expertise. It's one of those topics where everyone thinks they are an expert and few actually are. Still, I see two possible concerns here:
- Informed consent. The (opportunity) cost of doing a PhD -- in years and dollars -- is much higher than most young students realize. Further, most students are not knowledgeable about industry and view it as roughly akin to the pits of Mordor. If students were more knowledge about industry and had identified a specific, fulfilling, well-paying alternate career path, they might have made different choices.
- Societal cost. Many students are funded by tax dollars. These costs easily run into the six figures. If students do not use their PhD after graduation, one might ask whether that money could have better been directed toward fighting hunger or homelessness or disease or climate change.
Still, in STEM, I think we can say the answer is no. STEM students generally earn enough money to live on, and they learn skills that will be useful for a wide variety of careers. Further, the state of the academic job market is no secret. While we might be concerned that some students don't seem to be following an optimal or efficient career trajectory, such things are hard to judge -- everyone's goals are different, and "even the very wise cannot see all ends."