Let me work with arbitrary affine schemes $X = \text{Spec } k$. I believe there is a reasonable notion of a spin structure on a quadratic module $(V, q)$ over $k$, by which I mean a pair consisting of a finitely generated projective $k$-module (vector bundle over $X$) and a map $q : V \to k$ such that

- $q(\lambda v) = \lambda^2 q(v)$ for all $v \in V, \lambda \in k$, and
- $b(v, w) = q(v + w) - q(v) - q(w)$ is bilinear.

Namely, any such thing has an associated Clifford algebra $\text{Cl}(V, q)$, and a reasonable notion of spin structure in this context is that a spin structure on $(V, q)$ is a super Morita trivialization of $\text{Cl}(V, q)$, or somewhat more explicitly a finitely generated projective super $k$-module $M$ such that $\text{End}_k(M) \cong \text{Cl}(V, q)$ (here End is the super End) and such that $\text{Hom}_k(M, -)$ is faithful (or something like that).

In differential geometry the miracle is that any smooth manifold $M$ has a more-or-less canonically associated quadratic module (over $C^{\infty}(M)$), namely the tangent bundle of $M$ equipped with some Riemannian metric. The sense in which this is more-or-less canonical is that the space of Riemannian metrics on $M$ is contractible. But I don't see any analogue of this construction in algebraic geometry.

**Edit:** Following Alex Degtyarev's comment, here is a different candidate. One way to think about spin structures on a smooth manifold $M$ is that they are orientations with respect to real K-theory. Similarly, spin$^{\mathbb{C}}$ structures are orientations with respect to complex K-theory. The point of these orientations is that they provide pushforward maps in K-theory to a point, explicitly implemented by taking the index of a suitable Dirac operator.

But in algebraic geometry these pushforwards already exist: if $X$ is proper over a base $S$, then (maybe together with some other finiteness conditions) we can take the pushforward from coherent sheaves on $X$ to coherent sheaves on $S$. In particular, if $S = \text{Spec } \mathbb{C}$, pushforward takes vector bundles on a projective variety $X$ to finite-dimensional complex vector spaces. The relationship to the topological story is that smooth projective varieties over $\mathbb{C}$, or more generally complex manifolds, have a canonical spin$^{\mathbb{C}}$ structure.

Attached to a spin$^{\mathbb{C}}$ structure is a certain complex line bundle, and a choice of lift to a spin structure is precisely a choice of square root of this bundle. In the case of smooth projective varieties over $\mathbb{C}$ this line bundle is the canonical bundle, so one can think of spin structures on such things (compatible with their canonical spin$^{\mathbb{C}}$ structures) as square roots of canonical bundles (see e.g. the nLab for some details and references).

This suggests the following definition for a proper scheme $X$ over a base $S$: writing $f : X \to S$ for the anchor map, and $\omega_f \cong f^{!}(\mathcal{O}_S)$ for the dualizing complex, we might define a spin structure on $X$ to be a choice of square root of $\omega_f$. I don't know whether this definition is good for anything, but unlike the previous definition it applies to schemes and not just quadratic modules, and it recovers the usual notion of spin structure when applied to smooth projective varieties over $\mathbb{C}$.