It's more or less like with reading and writing ("I can write" doesn't mean "I'm a writer"), or driving, or other artifacts of modern life.
So basically everyone?
The Deepwater Horizon movie clips show workers arguing over all the things that have failed diagnostics testing, and how important that is or isn't. They're interacting with machinery 5.6km down.
Developed-world underground miners are already using heavy machinery that has to conform a cut to a specific 3d model which is adapted to the seam and the structural engineering of the tunnel. Open pit mines have similar structural concerns, but also environmental remediation issues. The trucks making that long journey down into the pit are all going robotic now.
An infantry unit in 2025 that hasn't already won or lost on overwhelming air superiority, is rapidly adapting drones to help it fight.
If you aren't making software, you're at least using software that somebody else created, you need to understand the problems and strengths of a software aided approach (as opposed to an apprentice aided approach, or a mechanically aided approach) and you're in a (hopefully) collaborative relationship to make that software better.
(though "obviously" I only meant people interacting with computers - among which every single one could benefit from adding some level of automation)
Do we gain more by having more people understand software? Do some risks get mitigated? I'd argue yes on both counts. And that's why I encourage people to get their kids to poke around with Scratch and maybe some Python. It's why smart people doing liberal arts degrees at Harvard still want to go and do CS50.
However "learning to program" and "understanding software" is not the same thing. Learning to program helps one to better understand software, but it's not a necessity or requirement of it.
"Everyone needs to learn" vs "People who needs to interact with software needs to better understand it" are very different points on the "understanding software" axis.
Most people don't want to learn to code because it simply doesn't interest them as a subject, a perfectly valid way of living your life.
Most professionals work with data but have low technical literacy. Imagine if most professionals could just query databases themselves. In a generation or two it could be made possible.
So, no, not everyone needs to be a car mechanic. But everyone who wants to drive a car needs to learn how to drive it safely, and would benefit from checking the oil, tire pressures, and knowing something about how their car worked to keep it in good, safe working order. If the only people who know all those things are professional mechanics, we're in a worse place.
Not everyone should hold a PhD in compiler design, but simply being able to write some BASIC commands might be hugely beneficial to society.
Reading and Writing is not something you learn just because it's beneficial to society. It's beneficial to one-self's life as it's the bases for communication. It can be placed on safety needs or belonging needs on the Maslows' Hierarchy of needs.
Basic arithmetic is requirement for continuity of one's life as you can't plan resource management (money, food) to function without it. It could be put on the safety needs.
I am having trouble positioning programming in any level below self actualization.