I agree that professors have a responsibility to tell their advisees the “facts of academic life” and some of us do that. Nevertheless, as a parent, I know that young adults often know better than those who are giving advice and for better or worse university professors often become role models for bright students who have ambitious plans. How easy it is to tell a promising scholar that it is a bad idea to become highly educated? I know that both my brother and I never were in doubt about the fact that we wanted a Ph.D. and to be university professors. No one could have convinced us otherwise at the age of 21.
So what can professors do? Well, we can let our undergraduate advisees know that there are many rewarding careers which do not require a Ph.D. and we can tell our Ph.D. students that there are many ways to use that education outside of an academic setting and that it is still valuable to have done it. Finally, we can post on places like this forum letting questioners know that a Ph.D. should be pursued only if one would regret not doing it afterward and that the earnings lost during the 5 or more years of graduate school will not be recovered simply by having that Ph.D.
Responsible faculty do this and also endeavor to have their students complete their Ph.D.s in a reasonable time (I always try for 5 years from the B.S. in physics).