Could also be a sign of a respiratory infection ... ball pythons lack the ability to "spit" mucus from an infection out of their mouths, so they attempt to "rub it out" and often drag their mouths against objects to do so.

-adam