Paul Halmos, a famous mathematician, was often approached by undergraduates who asked him if he thought they should go to grad school. He gave all of them the same advice: "No."
Now mind you, he was extremely enthusiastic about academia, and he would cheerfully encourage students who didn't immediately walk away, but insisted that they really wanted to do academic research.
I quit a well-paying job [added for HN: at a late-stage startup, no less] to slog through a difficult, low-paying PhD program and it was the best decision of my life. It was not a "practical" decision, certainly not for my earning prospects, but I wanted to do advanced research more badly than I wanted to do anything else.
The Ph.D. is designed to introduce you to the world of academic research and prepare you for a career as a professor. Full stop. I have no problem whatsoever with anyone who enters a Ph.D. program for any other reason, but they should not come with illusions about what they are getting into.