I am probably missing something obvious, but still...


Consider an oriented Riemannian $n$-dimensional vector bundle $\pi: E\rightarrow X$ over compact manifold $X$ with $\omega\_2(E)=0$ so it has spin structures. Let $P\_{SO}(E)$ denote the associated principal $SO\_n$ frame bundle. We would like to count the number of different spin structures over $E$.


$1)$ From the fibration $SO\_n\xrightarrow{i}P\_{SO}(E)\xrightarrow{\pi}X$ we have an exact sequence 
$0\rightarrow H^1(X, \mathbb{Z}\_2)\xrightarrow{{\pi}^\*}H^1(P\_{SO}(E), \mathbb{Z}\_2)\xrightarrow{i^\*}H^1(SO\_n , \mathbb{Z}\_2)$ from which we see that the number of different spin structures over $E$ is $H^1(X, \mathbb{Z}\_2)$. 


$2)$ On the other hand the short exact sequence $0\rightarrow\mathbb{Z}\_2\rightarrow Spin\_n\rightarrow SO\_n\rightarrow 1$ gives an exact sequence $H^0(X, SO\_n)\xrightarrow{\delta} H^1(X, \mathbb{Z}\_2)\rightarrow H^1(X, Spin\_n)\rightarrow H^1(X, SO\_n)$ from which the number of different spin-structures over $E$ is $H^1(X , \mathbb{Z}\_2)/\delta(H^0(X, SO\_n))$.


So why do we have different answers for the same object?



Number of spin structures
Your first answer is correct, and the second one is almost correct, but the problem is that they count different things:


In the first case, you count all twofold covers of $P = P\_{SO} E$ that restrict to a nontrivial cover of each fibre. In other words, you count $Spin (n)$-bundles $Q$, together with an isomorphism $\phi:Q \times\_{Spin(n)} SO(n) \cong P$ (up to isomorphism of $(P,\phi)$). Here $Q \times\_{Spin(n)} SO(n)$ is just a different way to write $Q/\mathbb{Z}\_2$.
This is the usual notion of a spin structure on $E$. 


Your second answer (correctly) counts the number of $Spin (n)$-principal bundles $Q \to X$ such that $Q /\mathbb{Z}\_2 $ \emph{admits} an isomorphism with $P$.


The point is that an abstract $Spin (n)$-bundle $Q \to X$ can yield many different spin structures on $P = Q/\mathbb{Z}\_2$. Say if $P$ is trivial, then the set of homotopy classes of isomorphisms $Q /\mathbb{Z}\_2 \to P$ is in bijection with $[X;SO(n)]$. This accounts for the division by the image $\delta$ in your second answer. 


For nontrivial $P$, your second answer is not quite correct, as your exact sequence is only a sequence of sets.


To see this is an example, let $X=S^1$ and $n \geq 3$. As $SO(n)$ $Spin(n)$ are connected, all principal bundles on $S^1$ are trivial. In this case $H^0 (X;SO(n))=[S^1;SO(n)]=Z/2$; $\delta$ is an isomorpism and the two terms to the left are null. The generator of $[S^1;SO(n)]$ gives an isomorphism of the trivial $SO(n)$-bundle that transforms the two spin structures into each other.


