I was wondering why the field of mathematics and that of logic are perceived as two distinct fields. Although could be pleased with the intuition that logic is rather meta-mathematics, still would like to know: were there any philosophers who may be said to have created this distinction? What is the philosophical background for distinguishing mathematics and logic?
Let me give you a historical background first. Until the end of 19th century logic was almost exclusively associated with Aristotelian logic, the syllogistic. This logic did not have quantifiers, or even propositional variables, in other words it was too weak to support even arithmetic, let alone the rest of mathematics (Chrysippus, an ancient Stoic, and Leibniz conceived of modern propositional logic before Frege, but their ideas were disregarded and largely forgotten). It is due to this weakness that philosophers like Locke, Hume, and Kant, considered analytic knowledge, achievable through "pure logic", as entirely trivial and incapable of producing anything of substance, see Was Locke right that analytic knowledge is vacuous? Mathematics, on the other hand, clearly displayed non-trivial truths, as Euclid's work amply demonstrated, and so could not possibly reduce to logic. Kant even invented a new notion of "synthetic a priori" that rely on additional faculty of productive imagination to take mathematics beyond mere logic. Friedman in Kant's Theory of Geometry explains in detail how the lack of quantification in the syllogistic forced early calculus and analysis to rely on intuitive ideas about motion, preventing more formal constructions.
So before introduction of quantificational logic by Frege and Peirce at the end of 19th century, see Bonevac's History of Quantification, mathematics and logic did not need to be specifically distinguished, they were worlds apart. Peirce, who took early philosophical notice of the algebraization and formalization of mathematics in 19th century, believed that it does not require formal logical foundations, and that quite the opposite, logic (whose scope he understood expansively in the Kantian-Hegelian sense) depends on mathematics philosophically. It was Frege who thought the other way, and developed the technical means for reducing arithmetic (and the rest of mathematics) to logic in his ground-breaking Begriffsschrift, eine der Arithmetischen Nachgebildete Formelsprache des Reinen Denkens (Concept-Script: A Formal Language for Pure Thought Modeled on that of Arithmetic, 1879), and in Grundgesetze der Arithmetik (1893) outlined a programme of reducing arithmetic to logic, known as logicism. This programme indeed envisioned logic, the new mathematical logic, in a single unit with mathematics and metamathematics, both as their tool and foundation.
However, logicism quickly ran into troubles, first with the Russell's paradox, which showed some of Frege's "basic laws of thought" to be problematic (Basic Law V, the law of extensions, combined with the substitution principle implied that every predicate defines a class, which produced Russell's paradoxical class). And then when Russell attempted to remedy this in his Principia it turned out that even Frege's logic could not support all of mathematics without extra assumptions of distinctly non-logical flavor, like the notorious axiom of reducibility. The final blow to classical logicism, in its last incarnation developed by Carnap, was delivered by Gödel's incompleteness theorem, which ended the idea that an all-encompassing logical system can serve as a foundation for both mathematics and itself, see Friedman's Logical Truth and Analyticity in Carnap's "Logical Syntax of Language" for detailed discussion of subtleties involved. It ended even a more generous proposal for basing meta-mathematics on "geometry of symbols" in addition to logic, Hilbert's formalism, see Was there a Kantian influence on Hilbert's formalist programme? More recently however, some neologicist proposals were advanced by Heck and Hale-Wright.
The distinction between mathematics and logic was almost universally held before modern times.
Aristotle's logical works (Prior and Posterior Analytics) are part of his works that later philosophers grouped as the Organon (tool). Hence, logic was seen as a tool.
Ancients like Boethius and medievals like St. Thomas Aquinas, and logicians like John Poinsot, et al. all considered logic to be an art (the art of reasoning). E.g., Aristotle writes in Metaphysics I (980b26) that “the human race lives by art and reasonings.” St. Thomas Aquinas writes in the proem of his Expositio libri Posteriorum Analyticorum:
…an art is needed to direct the act of reasoning, so that by it a man when performing the act of reasoning might proceed in an orderly and easy manner and without error.
And this art is logic (logica), i.e., the science of reason (rationalis scientia).
Hence why logic should be taught first (Sententia Ethic., lib. 6 l. 7 n. 17 [1211.]):
[T]he proper order of learning is that boys first be instructed in things pertaining to logic because logic teaches the method of the whole of philosophy. Next, they should be instructed in mathematics, which does not need experience and does not exceed the imagination. Third, in natural sciences, which, even though not exceeding sense and imagination, nevertheless require experience. Fourth, in the moral sciences, which require experience and a soul free from passions [...]. Fifth, in the sapiential and divine sciences, which exceed imagination and require a sharp mind.
This ordering is based on the three degrees of abstraction, of which mathematics was the second. Boethius, following Aristotle, proposed that the "Speculative sciences may be divided into three kinds: physics, mathematics, and metaphysics:"
- Physics [i.e., the natural sciences] deals with that which is in motion
[ens mobile or "mobile/changeable being"]
- Mathematics deals with that which is material and not in motion.
[∵ mathematical objects, "mathematicals," do not move or change]
- Metascience* deals with that which is not in motion nor material.
*i.e., "metaphysics" in the Aristotelian sense of the study of "being qua being"