My thesis adviser (physics) told me that he wanted to attain "immortality" through leaving a corpus of papers behind and he did exactly that. For him that made his life meaningful. He made decisions that I wouldn't have made, such as leaving the child and the mother of his child 2000 miles away to follow work. His kid showed up as a surly 14 year old after years of not seeing his dad and boy was he pissed...
This contradiction particularly turns up in computer science. You get ahead in CS by presenting papers at conferences and not by writing code. If you take teaching seriously you are also putting a lot of effort into teaching CS 101 or whatever the introductory course is required by many of the majors at your school.
There's not a lot of time and headspace to program at a professional level. Some people in CS really are great programmers, but that doesn't get you a career in the field, writing papers get you a career.
A lot of people in CS are bad coders. There was that time I got a little C program from a super famous CS professor that crashed before it got into main().
You might heard the phrase "publish or perish" and if you are on that track and spend too much time talking to the public, changing the world, or anything that isn't "publish" you will probably "perish".