Its very normal for a new snake to be a little defensive when you are making changes to their habitat. It is entirely possible that the snake has always had a bad attitude due to not being cared for properly. Most ball pythons, when cared for correctly, are very calm and docile snakes. All 10 of mine are easy to handle, but will give me the occasional strike if they are mad or hungry.

Don't let it bother you too much. Just like how us humans have mood swings, snakes do too sometimes. Just because the snake snapped at you once doesn't mean it will always be like that

If my snakes look like they might bite me, and I need to pick them up for whatever reason, I just go in there and try to cover their head while I pick them up as to not give them the opportunity to strike. Most of them ball up when I touch their faces. Don't show any fear! Ball pythons are not very scary. Even their bites are a common joke on the forum (because it is barely a bite).