I have read that prior to launch all people and tools are fastened down to prevent a rocket from losing the balance. Why doesn't the ISS begin to spin as astronauts are walking inside of it? Or is there some compensation mechanism for it to maintain its orientation?
Consider the differences in mass. A person is say 100 kg to keep it round.
The ISS masses 420,000kg right now. (It changes of course as modules are added, removed, changed, payload arrives, departs).
That is a very low effect that any one person can have. There are only 6 crew on the ISS at any one time, so their torquing effect is quite low.
Regardless there are 6 (?) control gyros that manage the orientation of the station. Like the gyros in the Hubble, they seem prone to failure and several have had to be replaced over the years.
Why doesn't ISS start to spin if people walk inside?
The ISS is already spinning. Its rotational period has been set to 93 minutes in order to match its orbital period and keep one side of the station permanently pointing at the earth. Moving astronauts will not make it start to spin, they will alter its spin.
We can consider two different effects that an astronaut could have on the station: (1) a permanent change in its state of rotation, or (2) a temporary change.
An example of a permanent change would be if an astronaut grabs a massive piece of equipment from a portion of the station that is far from the axis, brings it to a point on the axis, and leaves it there. This reduces the station's moment of inertia, and therefore permanently increases its rate of rotation due to conservation of angular momentum. This change will persist until counteracted by a compensating redistribution of mass away from the axis or possibly a use of CMGs or thrusters.
An example of a temporary change would be an astronaut moving their own body closer to the axis and then back out. Because the change is temporary, it only ends up changing the phase of the rotation. That's undesirable, because they want to maintain the same orientation relative to the earth.
It's possible in principle for an astronaut to do something like moving rapidly and continuously in a circle at a fixed distance from the axis, so as steal or donate a significant amount of angular momentum to the station. The effect would be temporary, and the geometry of the space station doesn't seem very helpful in trying to perform such a circuit.
Astronauts' motions could also cause the station's rotation to precess or wobble. This would presumably be corrected by the CMGs.
The CMGs (Control Moment Gyros) do have to compensate for astronaut motion. In the Mission Control Center, it was possible to tell if the astronauts were awake, based on how the CMGs were operating (four of them). But the motions are very small. The CMGs don't require any fuel for general operation, but periodically they get "saturated" and then a desaturation burn is required. The CMGs can each be pointed independently. So, initially they are pointed in different directions. If a rotation is required, they are moved to have a net angular momentum opposite to that, causing the vehicle to rotate (or stop rotating). Over time they will end up all aligned in the same direction which is "saturation".
During a launch, everything is fastened because a rocket accelerates really fast (3G or more), so any loose object "falls" really quickly and hits hard, potentially damaging important equipment.
Changes in the center of gravity similarly have huge effects during launch because of this large acceleration.
In orbit, forces are much smaller by comparison. Because everything is in 0 gravity, you only need small forces to move around. Also, forces are generally balanced. You move around the station by pushing off in one spot, then flying to the next wall where you stop by applying the same force in the opposite direction.
Despite this, the attitude of the ISS is controlled using gyroscopes (and thrusters, if necessary).