Quote Originally Posted by Adam_Wysocki
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
I was just about to bring this up... One of my balls has come down with an RI and is exhibiting this behavior. Look at your BP's nostrils and mouth, and inside its mouth to see if it is bubbly looking or it has excess saliva. You can also gently push the underside of its chin/throat upward and see if bubbles come out of the nostrils. If your ball shows signs of an RI, make sure your temps are good and take it to the vet.