Crowley does this too. Sometimes he'll go in his tank on his way out to do "missions" but usually he unloads after stretching for a bit in his room and he goes where he feel comfortable, usually with the tail touching a corner of some kind. I'm pretty sure handling and having the snake move around is why your snake does his business outside the tank. He is probably a clean snake and doesn't want to mess up his tank. When Crowley was a bit younger he very rarely peed or pooped in his tank other than after a shed because I guess while shedding he holds it for so long it needs to come out. Now days he only pees or poops in his tank if he knows I'm around to clean it. I had gone to bed when he did his shed not too long ago and he held in his pee and poop till the next day when I took him out. I'm pretty sure he knew I had gone to bed and he didn't want to sleep in his own feces. I gotta say ball pythons (and probably any other snake, I just don't have the experience with anything other than ball pythons) are smarter than given credit.