I opted out of pretty much all the math I could at university, and at mine you could opt out of almost all of it (I had to take one introductory course which mostly served to bring those who hadn't taken much in high school up to scratch, and one introductory stats course).
Many of my other courses touches on subjects where a mathematician probably would say "but that's math". E.g. my compiler courses of course touched on a lot on parsers and grammars that are effectively just math restated. But those restatements matter. Maybe if more math was taught in ways that downplayed the dense notations more people would actually stick with it.
And yes, we need familiarity with formal, logical reasoning, but the primitives you need to be able to understand coding are really basic, and often easiest introduced by showing people code rather than giving it the mathematical treatment.
It's not necessarily math itself that is the issue, but mathematical notation and the way we teach it - there's a very stark divide, I've observed, between those who prefer those really terse notations that you must take time to decipher, and those who want notations that can be read like prose. For my part I'm firmly in the latter camp.
The primitives are hopefully simple, but the logical implications are not. That's why it makes sense to have both.
(Then there's the whole "learning to code" part, of course. This is actually where middle and high school math provides useful application domains for learning to code, and people have tried to teach coding in schools since the 1980s.)