Homotopy fiber of the second Stiefel-Whitney class

The second Stiefel-Whitney class $$w_2$$ can be identified with a (homotopy class of) map $$BSO\to B^2\mathbb Z_2$$ (I write $$\mathbb Z_2$$ the cyclic group of order 2, and omit the dimension assumed to be high enough). It happens to have a model that is a group homomorphism (claimed in Basic Bundle Theory and K-Cohomology Invariants, Husemöller et al. section 12.3), and its homotopy fiber is the $$Spin$$ group (here), which allows us to write the fiber sequence $$\mathbb Z_2\to Spin\to SO \to B\mathbb Z_2$$ of group homomorphisms, so that we have the following fiber sequence of classifying spaces $$SO \to B\mathbb Z_2\to BSpin\to BSO \overset{w_2}{\to} B^2\mathbb Z_2$$ with $$SO \to B\mathbb Z_2$$ classifying the bundle $$Spin\to SO$$.

The question of lifting an oriented orthogonal structure to a $$Spin$$ structure is then answered by considering the homotopy class of the composed map into $$B^2\mathbb Z_2\simeq K(\mathbb Z_2,2)$$.

Two questions:
I assume $$SO\to B\mathbb Z_2$$ is the same in both fiber sequences and consider it defined by the second one.

1. I assume that we use the Segal classifying space for $$B\mathbb Z_2$$ which has a group structure. Why can $$SO\to B\mathbb Z_2$$ be chosen as a group homomorphism?

2. Why is $$Spin\to SO$$ the homotopy fiber? I read (see this answer or this comment) that a G-principal bundle $$P\to B$$ is a model for the homotopy fiber of its classifying map $$B\overset{f}{\to} BG$$, but I am unable to prove it. I get that they somehow classify the same thing: bundle morphisms to $$P$$ provided with a section, and maps to $$B$$ that have a trivializable pullback bundle. Being somewhat uncomfortable with universal properties in the homotopy category, I am looking for a more precise proof. I tried to use the fiber sequence $$\Omega BG \to P_f \to B$$ and prove that factorising $$P\to P_f \to EG$$ I have a weak equivalence between the homotopy fibers (which I know are weakly equivalent) but wasn't able to.