Why do academics prefer Mac/Linux?
It's not entirely accurate to state that Windows 'dominates' in the commercial world. While this is generally accurate in Desktop and Laptop computers, keep in mind that the vast majority of web (and other) servers are Linux-based. Keep in mind that 100% of the TOP500, a list of the 500 most powerful computer systems in the world, are on Linux. Keep in mind that Linux, especially if you include Android, is almost definitely the most prevalent operating system (kernel) in the world in terms of number of devices.

A lot of academic institutions, especially in more computing-related fields, are big supports of open-source/FLOSS communities, and Linux is obviously a very big underlying part of such communities.

And, most key in my experience, for academic/scientific environments, Mac and Linux have enormous computational advantages over Windows - the underlying Unix architecture model and the inherent support of very useful shells like bash, very useful device handles (eg. /dev/random, or device IO handles), etc. These things make the development of custom code, especially for scientific, computational, or instrument-interactive purposes, a lot easier than on Windows.

Even if you're not using custom code, I'd venture to guess that absolutely any computing cluster worth its salt is being run on some kind of Linux. If you want to just use that cluster, it's far less hassle to SSH in with a Mac or Linux computer with SSH built-in, than having to use something like Putty and fiddle around on Windows.

In all, science is very heavily dependent on computing. And high-level computing is very dependent on Linux. In my view this is the biggest reason that very compatible Unix-like systems like Mac and Linux are far more prevalent.