TITLE: Has philosophy ever clarified mathematics?
QUESTION [143 upvotes]: I've recently been reading some standard textbooks on the philosophy of mathematics, and I've become quite frustrated that (surely due to my own limitations) I don't seem to be gleaning any mathematical insights from them.
My naïve expectation would be that philosophy might take a difficult construction or proof, and clarify it by isolating the key ideas behind it. Having isolated the key ideas, philosophy might then highlight their relevance and thus point the way forward. Beyond this, I would hope that philosophy might elucidate the `true meaning' of axioms and of definitions by examining their ontology in a wider context.
In reality, to the best of my knowledge (please prove me wrong!) both of the above tasks seem to be carried out exclusively by mathematicians, physicists, computer scientists, and other natural scientists, as far as I can see. To play the devil's advocate, philosophy seems to me like it might historically have largely played an opposite role, labeling certain objects as "unreal" and "unnatural" which in fact later turned out to be fruitful to study (negative numbers, irrational numbers, complex numbers...).

Question: Has it ever happened that philosophy has elucidated and clarified a mathematical concept, proof, or construction in a way useful to research mathematicians? 

Philosophers have created much new mathematics (e.g. the work of C.S. Peirce, much of which is bona fide mathematical research), but the question is not about this, but rather about philosophy as practiced by philosophers providing elucidation, explanation, and clarification of existing mathematics.

REPLY [5 votes]: Bernhard Riemann's famous 1854 Habilitation lecture "On the hypotheses…" owed more to the influence of the anti-Kantian philosopher Johann Friedrich Herbart than to Kant himself.  Here one could mention an illuminating article by Nowak:

G. Nowak, in The history of modern mathematics, Vol. I (Poughkeepsie, NY, 1989), 17–46, Academic Press, Boston, MA, 1989.

Nowak argues that

Herbart's constructive approach to space, already cited, mirrored the content of Riemann's reference to Gauss in that both discussed construction of spaces rather than construction in space. 
Riemann followed Herbart in rejecting Kant's view of space as an a priori category of thought, instead seeing space as a concept which possessed properties and was capable of change and variation. Riemann copied some passages from Herbart on this subject, and the Fragmente philosophischen Inhalts included in his published works contain a passage in which Riemann cites Herbart as demonstrating the falsity of Kant's view. 
Riemann took from Herbart the view that the construction of spatial objects was possible in intuition and independent of our perceptions in physical space. Riemann extended this idea to allow for the possibility that these spaces would not obey the axioms of Euclidean geometry. We know from Riemann's notes on Herbart that he read Herbart's Psychologie als Wissenschaft.

It is possible that, had Kant's ideas about infinite space not been challenged by Herbart, the field we know today as Riemannian geometry may have developed much later.
This is meant to complement Thomas Klimpel's answer on Riemann.
For those with access to mathscinet, more information can be found here.
Note. Peter Heinig pointed out that the historian David Rowe similarly holds that Riemann was more of a Herbartian than Kantian; see comments below and also Rowe's review.