Going to the gym and using a forklift
There is an implicit agreement that mathematics is funded, for the most part by the public, as a way to advance the state of knowledge and propagate (even if very indirectly) what has learned for the public good.
It was never about helping individual mathematicians demonstrate that they are individually good at math. It happened to work out that way, but it wasn't the goal.
This is a good metaphor for treating the means as an end, thanks. And I agree with your parent comment that that is largely the misalignment that Terence is pointing out.