Well... I think every person has its own unique reasons. In my case there are many factors: (By the way, I am applying for theory)
1- I don't like to code someone else's idea. I like to make my own and smart algorithms and it is very pleasant to know that if it works, it is because YOUR idea works fine, and not because you just translate an idea into code.
2- I worked on industry and most of the times it was very boring. You lose most of your time debugging, coding design patterns, and dealing with technical difficulties (integrating different languages), reporting results, making documentation. And the only interesting thing for me is to think a clever algorithm and coding it. This is much more about research than working on industry.
3- I need a Phd to advance in my interests. If someday I would go back to industry I would like to be able to solve problems in smart ways and understand the latest papers on the topic. This is very difficult if you have not done some long and hard research before, like the research you do while you are doing a phD.
4- It could be interesting to apply your knowledge to solve new problems that could eventually finish in making your own business. I think that (in software industry) there is a lot of things to improve. Many ideas and tools that are commonly used can be improved if some people dedicate enough time to research about the topic.
5- I can't avoid to imagine the happiness of being involved in a big research project with hundreds of researchers trying to change the world in some way (i.e. looking for a cure to cancer, or to aging, or to solve global warming, etc.)