Code is nowhere near as dense as it can be in most languages - we make considerations for human readers by making languages verbose on purpose to a much greater extent than most math (of course there are exceptions like e.g. J and K and similar languages). Most math violates the intent of pretty much every coding standard there is in focusing overly on density over readability to someone not intimately familiar. On top of that, math very often
omit a lot of detail in a way code can't, that requires a lot more effort from the reader. I get that it's intentional - the focus is on expressing what is different in terms of a shared context people familiar with the math already has, while in code only a few fringe languages tends to take this approach over favouring readability.
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.