What does a PhD in CS do for your career in software? Is it ultimately worth it?

Whether you pursue a PhD in Pure Science or Applied Science will determine your options.

Even if you obtain a PhD in Pure Science, which is extremely tough, it may not be enough to get you a job unless someone recognizes a relationship between your PhD and the potential of using it in the real world, such as Memory Storage. It’s possible that you’ll wind up as a Post-Doc.
If you have a PhD in Applied Sciences (Robotics, Information Security, or Deep Learning), it will be much simpler for you to get into the business since you will be using your research abilities to help commercialize a technology based on your findings. This is also more intriguing since you will be able to apply your PhD to real-world problems that you would not normally meet in a lab.
So, if you want to get a PhD in software for a non-academic job, select a real-world problem that the market wants to solve, and that should lead you in the right direction. Google, Apple, Microsoft, Amazon, and a slew of other IT firms employ PhDs with expertise in areas such as software/memory optimization, cloud security, deep learning, industrial robotics, and a variety of other fields.

To answer your question, Is it worth it? PhD is for you if you love the challenge of tackling a problem that has never been addressed before and don’t mind working in an unstructured atmosphere with little direction. Phd isn’t for you if you desire a stable career that entails working on topics you’re familiar with.