Everything takes writing. Whether it is a video game, movie script, TV show, youtube channel, they all rely on good writing, a good story to captivate and keep their audience entertained.
As you stated, there are many mediums these days. One of which is ebooks. For the first time, someone can have thousands of books on one device at the tip of their fingers. Don't want to read the book yourself? Audio books! (there are also hacks you can do to have the book read to you even if it is not an audio book but that's for another discussion). So why write a book that goes on a shelf?
The respect for story telling. The appreciation of classical literature. The thought that one day, your story can be on the same shelf as your favorite author growing up. To be the next author that pioneers a new wave of inspired writers because of your story.
Many books also are turned into movies if they are a huge hit. Look at Game of Thrones, Twilight, Lord of the Rings, The notebook, 50 Shades of Grey, Chronicles of Narnia. All classic books written within recent history (yes I know with the exception of a couple), that have lead the way in novels and movies. Many more stories from the past that we read in schools also have a movie to go with it.
Speaking from personal experience here, I write using my macbook pro and with it their Word equivalent app called Pages. One of their sharing options is to download it as an Ebook(can also do PDF, word, and a couple other formats). It honestly gave me chills just seeing the book I was working on in an ebook format sitting there on my phone.
Why does anyone do anything when there are other ways, better ways, newer ways to do things? Because that is what drives them to go forward. Some people here have admitted to even writing their notes and drafts with pen and paper before going to the computer!
Sure, it is hard to make a living as a novelist. Most are lucky to even sell enough to write full time. It's not about money though, it's not about being hip and trendy. It's about telling a story in the way you want it told best and the appreciation and passion for it always shows.
Teachers, most of them are very smart individuals who have master degrees in their fields. Some, even PHDs. So why teach at a job that you are lucky to see at most 40,000 dollars a year when you can go work and make 150,000 or more? Because they love teaching and want to share the beauty of their field with the youth in hopes to inspire more minds.