I think in this instance, Jeff, you’re wrong. A mayor who knew how to code would be a great improvement. Perhaps he doesn’t need to learn how to code, but ideally he would know about data, standards, algorithms, security, privacy… a lot of the job of a mayor is dealing with bureacracy; if that mayor could tell when there was a technical solution to a problem that avoided the bureaucratic one, maybe he could spend less on the bureaucracy.
Your wider point that not everyone needs to learn to code is true, with the same caveats; if you don’t know when code can solve a problem, how will you know when code can solve a problem? I’ve helped many people in the past with macros that saved them hours of repetitive work - they just didn’t know it could be done.
As others have pointed out, most people don’t use much of their school education, but it serves the important purpose of telling you what kind of thing is out there, should you need to know it. Learning history tells you something of the politics of a situation, and this is a similar arena needing context.