Why do so many PhDs choose to join academia instead of industry given the pay in academia is considerably lower and the workload is much heavier?
In CS field, an entry-level software engineer in top-tier tech
  companies (e.g. Google, Facebook, etc.) could earn as much as a
  20-year experience professor....Why do so many PhDs still choose to be a professor while they have the choice to go to the industry?


First, your assumption is wrong. Most PhDs end up in industry. I don't have any source but I think this is from 90 - 99%.

If you limit your question to the 1% - 10% that become professors, they are all very successful, i.e. they have plenty of papers, promising research direction, strong network etc etc. And there is a reason for their success: they have passion, and when you have passion, money is likely not the most important thing in life.

Except for machine learning, in most areas in CS, you need to stay in academia to do research. And there are many benefits that you can only have when working in academia.


You take credit for what you have done. Products in industry are developed by a large team, and nobody can take full credit for it. But researchers can take full credit for what they do in their papers. 
Reputation: you are invited to give talk, become program committee members, etc etc, and everybody will know you. I would be excited to meet an author whose paper I have read. I'm not excited at all to meet a Google employee. (I'm living in Mountain View, a small city with 80,000 residents, but more than 20,000 Google employees)
Do interesting jobs. You always work on new things in research, while the majority of tasks of a software engineer are maintenance, fix bugs etc.


(I'm a software engineer if you are curious)