Bored? Low on minerals? Too many parasites?
Dogs do this instinctively too when they might need something from the dirt.