"i picked him up by the tail"

Why??

Any snake will go through periods when they don't to be messed with. This could cause an otherwise docile snake to bite or get defensive. Approach from his level, not above and make sure he's aware of your hand. Then when you pick him up slide your hands underneath him and pick him up while supporting his body. do this in a loose manner instead of grasping and restraining. And never pick a snake up by the tail. It doesn't feel good on the vertebrae. A snake that size is way too heavy to pick up by the tail. That's too much weight and stress placed on just a small section of the spine/tail. Have someone pick you up off the ground by the finger, toe or lip and see how that feels.

Is it possible that the snake is going into shed or is too warm? I've had even rubber boas (most docile snake you'll ever meet) get in really bad defensive mood when overheated. Reminds me of a story. Had a WC king snake that was very tame for several years.One day he got overheated and when I reached in to pick him up he bit the crap out of me multiple times and this was nearly a 5 ft snake. ouch. He never did it again. They just get that way when they are too hot.