Let me begin with some motivation. In calculating the Chern-Simons invariant of a $U(1)$ connection $A$ on a 3-manifold $M$, we can proceed by picking a bounding 4-manifold $X$ with $\partial X = M$ and an extension of $A$ to $X$ and write $$ CS(A)=\frac{k}{4 \pi^2}\int_X dA \wedge dA, $$ where the level $k$ must be an integer for this expression to be well-defined up to $2 \pi i$ when we choose a different bounding 4-manifold. However, if we have a spin structure everywhere, then on a closed 4-manifold, this expression is always an even multiple of $2\pi i$ since the intersection form is even. Thus, we can let $k$ be a half-integer and still get a well-defined invariant one we exponentiate.
I'm interested in understanding what's going on here on a more general level. It seems that often when we have a spin structure (or some other geometric structure) characteristic classes of bundles other than the tangent bundle turn out to have some divisibility propertyLet me phrase this another way.
My question is: on a principal bundle, where does one see what the spin structure gives If you?
In particular, if we have a principal bundle for say a finite groupspin 4-manifold $G$, then this is classified by$X$ and a map $$ f:X\to BG. $$ A cohomology class $\omega \in H^k(BG, \mathbb{Z})$ gives$X \to K(G,2)$, the pullback of a class in $f^*\omega \in H^k(X,\mathbb{Z})$$H^4(K(G,2),\mathbb{R}/\mathbb{Z})$ is actually defined up to even integers.
I want to know how the vanishing of certain characteristic classes of the tangent bundle, eg.why this happens for $w_2$, imply$H^4(K(G,2),\mathbb{R}/\mathbb{Z})$ and in which other cases it happens. I imagine the vanishing ofanswer has to do with relations involving $f^*\omega$$w_2$ in some reduction $H^k(X,\mathbb{Z}/n\mathbb{Z})$, eg.the $n=2$$p=2$ Steenrod algebra such as Wu's relation.