How and why did mathematicians develop spin-manifolds in differential geometry?
I can't give a comprehensive history (if you don't get that here, you might try [hsm.se]---a lot of mathematicians are active on that site), nor can I explain how or why the theory of spin manifolds first emerged. But I think I can say something about how and why spin manifolds became important.
The pre-history is an observation due to some combination of Atiyah and Hirzebruch that a certain characteristic number, the $\hat{A}$-genus, happens to take integer values on spin manifolds (a priori it is a rational number). I believe they were able to prove it using spin cobordism theory (though I'm not sure), but it still called for a convincing conceptual explanation.
This was certainly on Atiyah and Singer's minds when they were working on the index theorem, which computes the Fredholm index of an elliptic (pseudo)differential operator in terms of topological data. This is undoubtedly why in their Index of Elliptic Operators III they introduced the spinor Dirac operator associated to a spin manifold. The index of this operator is obviously an integer on one hand, and on the other hand they calculated that the index is precisely the $\hat{A}$-genus, beautifully explaining Atiyah and Hirzebruch's observation.
Moreover, Atiyah and Singer realized that many of the other operators used to give applications of their index theorem (including the de Rham operator, the signature operator, and the Dolbeault operator) can be constructed in a uniform way using the representation theory of Clifford algebras, so in a certain sense the spinor Dirac operator is the fundamental example in index theory and therefore has its tentacles in many different parts of geometry and topology. This observation explains why spin geometry is so ubiquitous in the theory of positive scalar curvature obstructions, for instance.
The significance of this operator, and therefore spin geometry, was elevated and clarified by the development of K-homology (the homology theory corresponding to the K-theory spectrum). Perhaps the most fundamental mathematical explanation of the importance of spin manifolds is that the spin condition corresponds to orientability for the KO-theory spectrum, and spin manifolds equipped with spinor Dirac operators correspond to the fundamental classes. (The counterpart for traditional K-theory is the spin$^c$ condition.) This was inspired by Atiyah, who argued that there should be a model of K-homology in which the generators are elliptic pseudo-differential operators, and sorted out by Baum and Douglas. The result is that spin geometry infiltrates many problems that involve topological K-theory.
The next (and current) chapter in the story involves the recent interest in loop spaces of manifolds, inspired by physics. It turns out that a spin structure on a manifold is in some sense the same thing as an orientation on its loop space, an observation which Witten used to sketch a proof of the Atiyah-Singer index theorem. There is another kind of structure on a manifold - a string structure - which corresponds to a spin structure on the loop space, and Witten constructed an invariant (the Witten genus) which he argued ought to be the index of a loop space Dirac operator. So far as I know nobody knows how to construct such an operator, but the Witten genus provided motivation for a lot of exciting modern geometry and topology, including topological modular forms and Stolz-Teichner functorial field theories.
The concept of spinor is a fascinating one, not only from the mathematical point of view but also from the physical point of view: I find extremely remarkable that some of the fundamental particles of nature are actually described in terms of spinors, a fact that has been extensively verified experimentally. Therefore, spin geometry is not just an abstract mathematical theory, but the language in which describe at least some aspects of the universe.
Spinors were invented, or rather discovered, by E. Cartan 1913 in his work on the classification of complex irreducible representations of simple Lie groups, where he discovered the "spinorial" representations of orthogonal groups. Fifteen years later, P. Dirac independently invented spinors in his attempt to find a "relativistic wave equation".
E. Cartan made the connection between both constructions much later, in 1937. However, he was dissatisfied with the status of the theory of spinors, as he was fearing that it would not be possible to define spinors globally on a manifold. Then, spin structures on manifolds came along (I am not sure exactly when and how) and it was clear that one can define spinors on a manifold through the associated bundle construction of a spin structure.
What I want to stress in this answer is the following: it has been widely accepted that the right mathematical set up to deal with spinors is that of spin structures on manifolds. However this is some times not the most convenient formalism: in particular it is too restrictive for many physical applications, especially in the context of String Theory (I can elaborate on this if needed). In order to obtain a general theory of spinors on a manifold one has to get rid of the concept of spin structure. Instead, one defines a spinor bundle $S$ as a bundle of (say irreducible) Clifford modules over the bundle of Clifford algebras $Cl(M,g)$ of your pseudo-Riemannian manifold $(M,g)$. This approach was already advocated by E. Schrodinger (in the language of that time), but it was soon forgotten when the description in terms of spin groups gained favor. Note that $Cl(M,g)$ is not obstructed, but, depending on the representation used, $S$ may be. Clearly, if $(M,g)$ admits a spin structure $P$, it admits a bundle of irreducible Clifford modules over $Cl(M,g)$ which can be constructed as an associated vector bundle to $P$. However, what about the other direction? The manifold $(M,g)$ needs to be spin in order to admit a bundle of irreducible Clifford modules over $(M,g)$? The answer to the latter question is big no. This can already be seen from the theory of spin$^c$ structures. There are manifolds that admit spin$^c$ structures that do not admit any spin structure, and such spin$^c$ structure can be used to construct bundles of irreducible complex Clifford modules over $Cl(M,g)$. Obtaining the general topological obstruction to the existence of a bundle of irreducible/faithful Clifford modules over $(M,g)$ is a subtle mathematical problem addressed only relatively recently in the literature in the work of T. Friedrich, A. Trautman, C. Lazaroiu and C. S. Shahbazi.