Why does the Stern–Gerlach quantum spin experiment conflict with classical mechanics? My understanding of the Stern–Gerlach experiment is that neutral (0 total charge) particles are sent through a non-homogeneous magnetic field, with the expectation that the field will push that particle's path higher or lower on a detector because of the collective spin of that particle. While the detector can detect particles in a two-dimensional surface, the results of the experiment are that particles appear in only two localized areas directly above the path of the particle stream, or directly below the path of the particle stream - spin up or spin down. The conclusions from these measurements are that the particle, when measured, will always have about the same magnitude.
Why does this not follow from classical mechanical theory related to magnetism? If you shot a magnet through a similar apparatus, I would expect the magnet to be rotated to align with the magnetic field in some way which, at high enough field strengths relative to the mass of the magnet, would cause us to measure basically the same magnitude as if the magnet entered the apparatus pre-aligned with the field.
How is my explanation incorrect?
 A: The key realization is that the particles have an angular momentum $\vec{L}$ aligned with their magnetic moment $\vec{\mu}$.  Specifically,  $\vec{\mu} = \gamma \vec{L}$, where $\gamma$ is the gyromagnetic ratio.
So if such a particle enters a magnetic field, and we try to treat it classically, we would expect it to experience a torque, which will change its angular momentum:
$$
\vec{\tau} = \frac{d\vec{L}}{dt} = \vec{\mu} \times \vec{B} = \gamma \vec{L} \times \vec{B} = -\vec{\Omega} \times \vec{L},
$$
where $\vec{\Omega} = \gamma \vec{B}$.
This can be recognized as the equation for gyroscopic precession.  This implies that classically, the angular momentum (and therefore the magnetic moment of the particle) will not "flip" over to point along $\vec{B}$.  Instead, it will precess about the axis of $\vec{B}$;  and importantly, the component of $\vec{L}$ along $\vec{B}$ will remain constant at all times.
So if we fired a bunch of classical particles into a Stern-Gerlach device with a magnetic field along the $z$-direction, we would expect them to be sorted according to their $L_z$ component.  Classically, this quantity is entirely continuous, and so we would expect a continuous spread of impacts along the screen.  Of course, this is not what we actually observe.
A: Suppose you shot a large number of small classical magnetic dipoles with magnetic moment $\vec{\mu}$ through the field. Imagine the dipoles to be small enough that they could be treated as the particles of an ideal gas, and they are "boiled" out of some source into the magnetic field.  
We would then expect each of the particle's components of velocity to be randomly distributed according to the Maxwell velocity distribution - because that is the classical result for an ideal gas. So the alignment of their magnetic moments would also start out random.
The dipoles would experience both a force and a torque from the magnetic field. The torque would cause them to rotate, and the force would, as you said, tend to line them up with the  magnetic field, until they are in a minimum energy state. This alignment would take some time however, and, since they started out with random velocity and random orientation of their magnetic moment vector to the field, their final velocities once aligned would show some variation.
The key, though, that makes the motion of the particles vary AFTER they are aligned, is the nonuniform magnetic field. Suppose the field is in the z direction, and varies with z.
The particles are in a minimum potential energy state once aligned, with potential energy
$E=-\vec{\mu} \cdot\vec{B} = -\mu B $
But the magnetic field $B(z)$ varies with z, so the dipole still experiences a force
$\dfrac{\partial E}{\partial z} = F(z) = \mu\dfrac {\partial B(z)}{\partial z}$
So the classical dipoles, with randomly distributed magnetic moment orientations and velocities at start, would drift in varying directions, hit various positions on the detector.
But if the magnetic dipoles were somehow constrained to be on only two possible initial directions, you would expect to see a concentration of hits on two locations of the detector, and nothing anywhere else. They would start out with only two orientations with respect to the field and end up being deflected into only two concentrations on the detector. They'd have only two end states of "lining up" with the magnetic field, and then drift apart due to the nonuniform magnetic field.
So the Stern Gerlach experiment is evidence that the magnetic moment of electrons in atoms, and thus electron spin, is quantized, because the results resemble the second case above, not the first. The initial direction of the magnetic moment of the electron is limited by quantization of spin.
A: Years have passed since the original post but this article by De Raedt et al. from last year by might be helpful. (The paper is about neutrons, not silver atoms.)
Classical, Quantum and Event-by-Event Simulation of a Stern–Gerlach Experiment with Neutrons
Three different ways of modelling a Stern-Gerlach experiment are implemented with the authors' software. The QM and classical models differ in results, with the QM model matching experimental results. The interesting bit is their third model named "Event by event". This is, in essence the same as the classical model but with the minimal necessary 'artificial' modification required such that the results match the results of the QM model.
The paper provides an answer to your question because it pinpoints how the classical model fails and approximately when and where in the trajectory of the particle some hocus pocus has to be applied to the classical model to achieve results that match experimental data.
The hocus pocus is this: The event by event model assumes that the axis of spin will instantly assume one of two orientations as the particle enters a magnetic field of a strength higher than a certain threshold. A random number generator is used to decide that orientation. Other than that, this event by event model is purely classical in nature.
A: NOTE: this answer ignores initial angular momentum along the magnetic moment, so it isn't directly applicable to the silver atoms used in the actual Stern-Gerlach experiment. See the answer by Michael Seifert that takes angular momentum into account.

The magnet has a finite moment of inertia. What would happen when the magnet with "wrong" orientation enters Stern-Gerlach apparatus? Of course, the magnetic field will exert torque on it. The magnet starts rotating. After it comes to the equilibrium orientation, i.e. is oriented along the field, the torque is zero, but angular velocity is at maximum, and the magnet overshoots — just as in motion of usual oscillator.
If you find average magnetic moment over all the motion time, i.e. multiple periods of oscillation, you'll find that it has smaller magnitude than actual magnetic moment of the magnet. This means that net displacement in the direction of field is smaller. Now if there're lots of such identical magnets with random initial orientations, they all will have random average magnetic moment, and thus their displacement will form a continuum instead of just two points.
