Why do people say you shouldn't do a PhD unless you want a career in research?
Research is not just the most important aspect of any PhD program worth the name; it's the entire point. Everything you do as part of the program (teaching duties aside) is to prepare you for a career as a researcher. So getting a PhD without any intention of putting this research training to use would be like spending years as a baking apprentice without any intention of becoming a baker: maybe not a complete waste if you really like baking (but not enough to make it a career?), but almost inarguably not the best use of your time.
Lots of people get PhDs and don't become researchers, but if these people had known beforehand what industry they would end up in, odds are they could have gotten a better jump start on their career by getting a Master's degree focused on that industry and entering the workforce after one or two years (rather than 5+ for the PhD). There are exceptions to this principle, but they are relatively uncommon, and usually involve industry jobs that somewhat resemble research anyway.
I can think of only two other justifications for getting a PhD: learning for learning's sake, and prestige. The former is a noble goal, but if all you want to do is learn without contributing to the body of knowledge in your field, this is contrary to the spirit of (good) PhD programs as stated above. Furthermore, you can learn all you want in your free time without entering a PhD program. Find out what the standard graduate-level textbooks are in your field, and work through them. If your knowledge gets up to the research level in a particular topic, you can start reading recent research articles. (Your local library will likely have access.) As for prestige, this may be subjective, but spending five years of your life for a piece of paper is unlikely to be satisfying in the long run. And, speaking as someone who has a PhD, you'll soon learn that most people will not really want to address you as "Doctor."
Having said all that, if you do like (or think you would like) research, but are put off solely by the expected competition and stress, I urge you to be more open-minded. Academia is certainly competitive and stressful, but so are most careers worth having.
Although the primary goal of a PhD is to train you in performing scientific research, a career in academia is definitely not the only possible result. In fact, more PhDs end up not staying in academia and not becoming a professor. A lot of people I did my PhD with either work for research institutes or consultancy companies. They are in positions where their abstract thinking skills serve them well, and are appreciated by their employers. I ended up in a data scientist like position, where my programming skills, abstract thinking, quickly learning complex topics, and data analysis skills really shine. In this field a PhD is not exactly a requirement, but a big plus nonetheless.
Where your PhD hurts you if you for example apply for pure programming roles. There you have to compete with people who have exclusively spent their time programming, and your research skills are not a plus. So, it is also a matter of finding the right position where a PhD adds value.
Note that this answer may depend on the country you live. My impression is that in the Netherlands the attitude towards PhDs is not very negative. The impression I get from this site is that this is less the case in the US.
Why do people say you shouldn't do a PhD unless you want a career in research?
Wow, do people really say that? That's the most foolish advice I've ever heard.
An active researcher at a university produces some significant number of PhD students. There is simply no way for the number of research jobs to grow fast enough for all of those students to get research jobs. This is why people talk about PhD birth control.
Better advice would be:
- Don't do a PhD unless you think you'll enjoy doing research in the process of getting the PhD.
- If you have your heart set on a career in research, readjust your expectations and figure out a backup plan so you won't be bitter and unhappy in the overwhelmingly likely event that it doesn't work out that way.