Also, I might be saying nonsense here but I think the reason that people from Physics or other STEM fields are usually very good programmers is that they are thaught a lot of "debugging" skills during their training, especially in experimental fields.

I believe this is true, at least for myself, if you limit the STEM to Science, but I'll note it starts with your first bullet point, "Make a mental model". Here's a pretty good (top Google "process of science") diagram and description of the The Scientific Process: http://www2.nau.edu/~gaud/bio372/class/behavior/sciproc.htm
and you can see how pretty much every part of it has direct utility in the mechanics of software development.

I'm weaseling with "the mechanics" because software development almost always involves a lot more direct, unscripted, and frequent interaction with other people. By comparison, what happens in science can be a lot more constrained, with the closest part of that sort of thing being funding. You also need to keep the people who you're delivering your results to happy, be they scientific journals or superiors and peers who need them for more direct uses, and having a working relationship with those under you, which for a PI could be postdocs, grad and undergrad students, and lab techs. And depending on the field the usual bureaucracy regulating what you do.

The mentoring model is almost infinitely stronger in science. When you're an undergrad, you get mentored by your grad student TAs, and if your smart, you spend at least a little time your favorite professors (in the best cases, they get free or much cheaper labor, potentially on high risk and/or apparently low gain work). In my personal experience, if you don't waste their time, Nobelists are at minimum happy to provide a little advice in passing.

The grad students both mentor the undergrads and are mentored by their PI and his more experienced postdocs and grad students, it's an apprenticeship model. Once you have your Ph.D., there's still a good chance you'll do, or should so, some mentoring in whatever lab you end up in, industrial or academic. In the academic track you'll be expected to formally teach classes, and good schools will demand adequate performance. If a PI, you cultivate your crew of lab techs, students, and postdocs. Personal reputation is also more generally important, especially lower down.

(Note that I've seen these positive behaviors at 3 levels of academic institutions, the low end one level above community college 4 year college where the professors are there to teach, a highest end "R1" university, and a middling "high research activity" university.)

Hmmm, there's also a lot of gatekeeping in science which isn't present in our field. It's legendary how many "college dropouts" for whatever reason ($$$ in mine) go on to be successful, whereas it probably isn't easy to become a bottom of the totem pole lab tech without an undergraduate degree. Which is the gateway to grad school and the Ph.D. where you can become more independent, and doing that in the American model requires passing quals, doing original research and defending that. There are of course exceptions to the typical path, but they're a lot more unusual.