They indeed both work, but think about what the difference is when pushing the button with either resistors. in both cases you register the button push, that's great, but:
with the 10k resistor you now have a current of 5V/10000-Ohm = 0.5mA flowing from 5V to ground.
With the 220-ohm resistor you now have a current of 5/220-Ohm = 23mA flowing from 5V to ground.
Imagine this were battery powered. For no reason at all (since they both work), when the button is pushed your system now draws 50 times more power from your battery than the other option :). That's why they use such high values of resistors (why not even higher values? they still need to be able to pull up/pull down the pin reliably, the highest values of resistors are getting pretty close to electrical insulators).