I understand why you'd feel disillusioned if you went into the surveillance capitalism part of big tech in the USA. It's probably similar to what a lot of people will feel about the AI industry when it does to the office floor what robotic automation did the factory floor a few decades ago. I'm not sure I'm quite as optimistic about tech as you are, but I completely agree with your point on how tech is more than just silicon valley.
There is the medical tech that you mention, but there is also green energy tech, farming tech and so on. All which are areas that are improving the lives on the planet for a lot of people. Of course many of these industries are kind of hard to break into if you're a "software engineer" and not really used to working with machinery, but it's not like it's impossible and it's certainly an area where your stuff will stick around. Some of the earliest software I build for solar plant data loggers will probably live a lot longer than me.
I do think people should follow what they want to do though. I completely get wanting to try something different and I don't think the authors reasons are any worse than people who burn out because of all the pseudo-management-bullshit in our industry. You don't really see anyone questioning when someone becomes a woodworker because they're fed up with associate agile scrum it business partner managers and little boxes on a board.