That’s because, in the natural sciences, a lot of what was considered knowledge long ago has been found out to be incorrect.
If you study Galen (https://en.wikipedia.org/wiki/Galen) or Hippocrates (https://en.wikipedia.org/wiki/Hippocrates), or Newton’s works on alchemy, you aren’t studying medicine or chemistry, but the history thereof.
On the other hand, look at the Pythagorean theorem. There has been a bit of chipping at its corners when non-Euclidean geometry was discovered/invented, but it remains true in large branches of mathematics.
And this isn’t a matter of centuries. A lot of genetics work that predates the discovery of the structure of DNA isn’t worth studying anymore.
> At what point can we still say with a straight face that it makes sense to pour millions of dollars into mathematics research when its only objective seems reaching the next highest peak of hyper-specialization?
Luckily, lots of mathematics research is fairly cheap. As Alfréd Rényi said (https://en.wikipedia.org/wiki/Alfréd_Rényi#Quotations) it runs on coffee.