Paraphrasing a math professor I had [mumble] decades ago:
"In theory, mathematics is all pure & abstract logic, with no connection whatsoever to the real world.
"In practice, if you want funding for your mathematical research, or for more than a puny handful of people to ever look at what you did, then you had best pay plenty of attention to the real-world usefulness of it."
> In theory, mathematics is all pure & abstract logic, with no connection whatsoever to the real world.
I understand what your math professor was trying to communicate, but at the same time, I think framing things this way begs the question that mathematical entities are not "real". It's more accurate (or at least less question begging) to say something like "mathematics, or mathematical objects, doesn't seem to have any obvious or direct connection to the material or physical world". Putting things this way doesn't reify mathematical entities, but it also doesn't presume that they don't exist.
I imagine that my old prof. would say something like: "Mathematicians agreed long ago on a very short and exacting definition for 'real' numbers, and got on with doing useful work. Philosophers never agree on short nor exacting definitions for anything, and certainly don't want to do anything useful."
"In theory, mathematics is all pure & abstract logic, with no connection whatsoever to the real world.
"In practice, if you want funding for your mathematical research, or for more than a puny handful of people to ever look at what you did, then you had best pay plenty of attention to the real-world usefulness of it."