There is no doubt that the mathematical mindset makes people better programmers. It trains you to think of all the edge cases, for example.
Of course, there are other ways to develop that mindset as a programmer without going to college, but taking some math classes where you prove things is a really convenient/efficient way to do it.
Your first sentence is correct, on average.
I bolded the parts which I do not think are proven. I believe that the real explanation for those portions is a combination of sample bias and reversed correlation-causation error.
I think the only claims we could confidently make about this issue are:
-The mathematical mindset makes it easier to program (ie write procedural instructions which rely heavily on basic algebraic expressions, ie math).
-People who have a mathematical mindset are more likely to enter math/science schools in college.
-People who have a mathematical mindset are more likely to understand and succeed at math/science curriculum.
-People without a mathematical mindset are unlikely to pursue math/science beyond the bare minimum (college algebra), so not only will they lack the mathematical mindset, they also will never have reason to seriously engage with extended formal logic like proofs.
-People with a mathematical mindset will, through their own choices, be exposed to curriculum and situations where their existing mathematical mindset can be honed.
That is-- those with a higher capacity for mathematical reasoning will self-select into and persist to graduation/completion of situations where their capacity has been harnessed into functional skill.
However, the above statement does not at all mean that the mathematical mindset itself is being created/implanted by math/CS departments.
The person makes the degree. The degree doesn't make the person,
But we have to pretend it does, for ideological reasons.
Over the past 50 years we've seen the establishment of a socially-motivated (as opposed to factual/scientifically-informed) belief that "you can be anything you put your mind to" and theoretically every kid could get that CS degree if we give them enough support/funding/nutrition/affirmation/social services/parenting/intervention/accommodation. It's a really clumsy and poorly thought out but well-meaning, egalitarianism.
Unfortunately, being well-meant doesn't make something true. Human beings are NOT simplistic algorithms and do not behave in deterministic ways. Math reasoning is not the same as reading a history book and reasoning through a dialectic narrative. Exclusion runs counter to the modern social belief system, so people get nervous and start backing away if you were to make a statement like: "Mathematical reasoning is a trait possessed by a small subset of the population. We do not understand its origin. Some people have it and some don't. For those that have it, developing their skill through practice can give them access to specific career/salary advantages that are simply inaccessible to 90% of people, the same way no 5'9" man is going to be a starting Center or Forward on a successful NBA team. even if you had a blank check to give him world-class professional sport-specific coaching and general athletic training from age 8 onward. Indeed, it would be gross mismanagement of resources to pour that into him and expect him to succeed." Of course, the reason that statement makes keyboard warriors reach for their "Problematic Post Alert" button is because, unfortunately, it is chiefly brought up by people whose underlying beliefs are in fact problematic.