Snakes feel most threatened when you release them (set them down) or as you approach them. It's instinctive...they're predators but they are also preyed upon in nature, & I've seen many snakes that feel safe when held that as we let go of them, just panic & lash out at the nearest thing, even if it's the hand that just held them. Don't take it personally-they don't identify things visually...they know us best by scent & touch, whereas anything moving nearby is potentially food or a threat, so quick motion is apt to get a strike...silly sneks.