He bit you because he's a snake. Not a dog or cat that is trained and loyal. Snake's operate with a very primitive brain and they are ruled by their instincts. Sometimes that means they will bite you for no apparent reason whatsoever.
Having said that, it could have been a result of the cat sniffing him. Not because he was "mad" about it, but because he smelled a warm blooded animal and was likely reacting out of either a defensive or food-driven instinct.
Check your temps and humidity, make sure they are within optimal parameters and watch how often you are handling him. A stressed snake will be more aggressive or flighty.
Btw, that's a good gruesome bite!! lol....![]()