riding a bike on a treadmill

That’s not true.
Hyperphysics - Bicycle Wheel as Gyroscope

From Joel Fajans’ homepage you can access the 9 MB PDF file of the entire article The Stability of the Bicycle - from Physics Today, 1970 (volume 23, I think.)

In it, the authors conduct experiments in which they demonstrate that it is not gyroscopic action but simple fork/steering geometry that makes a bicycle stable or unstable.

Sure, the faster the wheels, the more stable the bike - but it is not because of gyroscopic effects but rather because of the increased forces involved in steering inputs and in a greater sensitivity to deflections of the contact patch of the front tire.

Not really trying to start a debate here, but you can do a simple experiment. Get on a bicycle that’s on a set of rollers and don’t pedal and mark down how long you can balance yourself. Do the same experiment pedaling, you will find that the bike is much more stable when the wheels are spinning.

Read CurtC and douglips’ replies more carefully. We all agree that spinning wheels aid balance, but the question is what mechanism is in effect here. As they said, gyroscopic force is not important. What’s important is the sideways movement of the wheel. When you start falling to the right, you turn the handlebar to the right. If (and only if) the wheels are spinning, this moves the front wheel to the right. So the contact patch is now under the center of mass, and balance is regained. It’s easy to test this: just try riding in a narrow slot on the road, like a streetcar rail, so the front wheel cannot move sideways. You will not be able to balance the bike at all.

Why is it easier to balance on a moving bike than a non-moving one (revisited)?