The dough contains a lot of butter, which will melt and release water as steam while it bakes. Poking holes in the dough allows the steam to escape without causing the dough to bubble up so that you end up with flat evenly-shaped cookies. It also helps the shortbread to cook more evenly.