Those mathematical advances weren't developed in a vacuum, but made to solve some very specific problems which came from better measurements. So even Newtonian mechanics originated in solving problems trying to explain measurements, not that someone sat in their chamber and dreamed up cool math that happened to be very useful.
I agree.
Generally, the scientific method has mutually recursive turns of theory and observation. And I don't mean to imply that exist independently.
I'm just saying that if you get stuck, the two clearest ways out are to provide more observations or perturb the theory.
Number theory and algebraic geometry were developed for their own sake (i.e. "it is cool"), but later people found practical applications in cryptography.
So "useful math must be motivated by practice" is empirically false