I am currently reading a book on hen behaviour and it suggests this sort of behaviour is driven by frustration and/or boredom, of which the first fits your circumstances. You want to try to nip it in the bud, as the book also says it is a behaviour that can be learned by others.