Actually they generally don't bite out of defence, at least in my experience. He must have thought your finger was food. Be thankful he is this small - when they get bigger their teeth can go straight and deep into your flesh (ouch!).