It can be quite random, some ball pythons will hold it in as long as possible.
I read an article recently about how Justin Kobylka believes it to be a survival mechanism, as in the wild rodents can smell python poop and no self respecting rodent will go near a ball python.
In theory, your snake may be holding it in an attempt to increase the likelihood of a rodent "accidentally" entering his hide.