He felt the pain of insult. He was hurting. His pride was punctured. The defenses of his ego had been penetrated. He lay defeated. His glory was abused. He felt now he had to strike back, take revenge. This attack was the best form of defending his delicate ego. Or else this vicious world would keep pricking it. When ego attacks, it is also to build its defenses for the future. It seems that is it's only choice.
By nature, ego is defensive. It needs to preserve its perceptual superiority over others. It builds a wall which can protect it. The wall of people who talk well of that person, the wall of their praise, the wall of their acceptance. This wall gives ego its natural security. Ego needs to feel good about itself. The food of ego is praise. Ego can't handle criticism. Only humility handles criticism with grace. Humility has no defence, because it never claimed any superiority. It does not need a protection. Ego's superiority needs to be defended. It can't accept defeat. Hence, ego is defensive.