The earth does not fall into the sun because it has its own velocity. The gravitational attraction between the sun and the earth is strong enough to keep turning the earth so that it moves (almost) in a circle, but it is not strong enough to pull it in. The same is true of the moon. It has its own velocity, which keeps it in orbit rather than pulling it into the earth.
When you did Physical Science Experiment 11.1, you experienced this same effect. By twirling the weight, you gave it its own velocity. The string, however, was pulling the weight into the center of the circle. The weight never got to the center, however, because the string’s force (the centripetal force) was not great enough to pull the weight in. The best it could accomplish was to continually turn the weight so that it moved in the circle.
The centripetal force of the gravitational attraction between the earth and sun (or the moon and earth) is enough to keep the earth (or moon) in orbit, but not strong enough to pull it in.