Nothing prevents the electron's spin from being measured along a particular axis, and then subsequently measured along an axis perpendicular to the first. In this situation, however, the spins along the perpendicular axes would not be known simultaneously, so the uncertainty principle would not be violated.
As an example, say that we perform our own Stern-Gerlach Experiment, in which we send a beam of particles through a series of Stern-Gerlach magnets in order to measure their spins in various directions. First, let's measure spin in the $z$ direction, and then only keep those particles which we have found to be spin up. Now, we are in possession of a beam of particles which are all spin up in the $z$ direction.
Next, let's take this beam of $\left| +z\right\rangle$ particles and make a subsequent measurement in the $x$ direction. What we will find is that $50\%$ of the particles will be measured as spin right in the $x$ direction, (in the $\left| +x\right\rangle$ state) and $50\%$ will be found spin left in the $x$ direction (in the $\left|-x\right\rangle$ state). Finally, let's say we keep only the beam which we have measured to be in the $\left|+x\right\rangle$ state.
We may be tempted now to draw a conclusion which, classically, seems reasonable, but in reality is false. If from our first measurement we kept only particles in the $\left|+z\right\rangle$ state, and then out of those $\left|+z\right\rangle$ particles we kept only those which were found in the $\left|+x\right\rangle$ state, we may believe that we are now in possession of a beam of particles which are simultaneously spin up in the $z$ direction and spin right in the $x$ direction. This would violate the uncertainty principle, however, so something must be wrong with this conclusion. To answer what exactly is wrong, let's make one more spin measurement.
Let's take our beam which we first measured as $\left|+z\right\rangle$ and subsequently as $\left|+x\right\rangle$ and make another measurement on it in the $z$ direction. The result will be that $50\%$ of the particles will be found as spin up and $50\%$ will be found as spin down. But if all of the particles in the beam truly had been in the $\left|+z\right\rangle$ state after the measurement in the $x$ direction, we should have found $100\%$ of the particles spin up in the $z$ direction in our third measurement. Because this is not what we observe, we are forced to conclude that our measurement in the $x$ direction destroyed our previous knowledge gained about the system from the first $z$ measurement. Thus, we did not know the spin states of the $x$ and $z$ directions simultaneously, just as, qualitatively, the uncertainty principle states.