What is the logic behind spacecraft spinning to increase stability? How does angular momentum play a role in this?
Rotations about a principal axis for an object with three distinct principal moments of inertia are stable if the rotation is about the axis with the least or greatest moment of inertia but unstable if the rotation is about the axis with the intermediate moment of inertia.
Showing that this is the case is one of the torture tests for physics majors. One name for this phenomenon is the tennis racket theorem. You can easily see this by wrapping a rubber band about a book and tossing it with a bit of a spin. Give the book a flip about either the smallest and largest principal axes and you'll see a nice and stable rotation. Give it a flip about the intermediate axis and you'll see something a bit chaotic.
Some satellites take advantage of this phenomenon and establish a rotation that is more or less about either the smallest or largest principal axis. The satellite's control system can detect and correct deviations precisely because these rotations are stable.
The process is called spin stabilization and is not used on every spacecraft, but some. Most notably, it is not used on any manned craft since it would be detrimental to the health of the passengers.
Conservation of angular momentum applies. A body always spins about its principal axis. If the rocket already spins at a high RPM, it is much more diffcult to alter the axis of rotation - the rocket will be much more stable. See it that way: if you add just a little bit of rotation to a body at rest, it will slowly rotate. If you apply the same tiny bit of rotation to a fast-spinning object, its axis of rotation will barely even change.
Furthermore, a rotating rocket smoothes out any individual disturbance.
Its pretty much the same effect effect as a gyroscope or momentum wheel (which "absorb" angular momentum on demand), just with the whole rocket body and only on one axis.
Not that the rocket has to be de-spun from its usually high RPM (50 - 600) once it reaches its target orbit in order to release its payload (typical satellites can handle at most 2-5 RPM with their own attitude control). Various techniques are available, e.g. yoyo-despin, but this technique is not always seen as desirable because of the debris it generates.
A symmetric body with no torques applied with even a slight bit of internal damping (as all real object have) will eventually rotate about its principal axis with the lowest moment of inertia. The faster the spin (= higher angular momentum), the more effort it takes to alter the axis of the spin (= greater stability).