Use of Resistor in PinWheel Exercise
It's a pull-down resistor.

A pull-up or pull-down resistor is used the make sure that the input of a digital device is confined to strict logic levels, i.e +Vdd (positive, or HIGH) or GND (Ground, or LOW).

With the switch open and no resistor present, the Arduino pin is neither high nor low. It will probably read as low if you tried digitalRead(), but there's no guarantee. The probability of the pin being one or the other changes according to the layout of the PCB and other external factors; the pin is termed 'floating' because it could be at any voltage between Vdd and GND.

However, if you apply a pull-(somewhere) resistor you force the Arduino pin to one of either Vdd (up) or GND (down) until you press the switch, at which point the Arduino pin switches state.

If you removed the resistor and joined the switch directly to ground, what happens when the switch contacts close?

Think about it...

One side of the switch connected to Vdd.

The other side is connected to the Arduino and GND.

Close the switch, I dare you.

Vdd is now connected to GND