Jack learned that Wilfred fell asleep while on guard duty, and wants to make an example of him. Jack wants to punish him for turning a boulder into a giant trap to crush intruders. Jack doesn't give a reason for restraining Wilfred or for beating him - he just does it because he feels like it.