Your friend may have just wanted to take you down a notch with your interests in mind. I see the possibility that he thought your apology validated his views on some of his prior experiences with your ego; everyone has one after all. I have a strong aversion to discussing my smarts with anyone, my friends in particular. I'm terrified of explaining why they should see themselves as my equals, because when I can't, I have no way of seeing myself as theirs. I'm not sure I can know if I'm a particularly prideful person, but what I do know is that I'm a stark realist about what I actually have accomplished, and that it doesn't really slot into the whole of what anyone might need me to do. I always feel reflexively down when anyone asserts I'm more intelligent than they, I don't wish the sensation of a mental deficit which can't be articulated on anyone I know, save perhaps for the one coder friend of mine I see regularly; IRL he clearly has more egomania than you've worded out here.
_________________
"Standing on a well-chilled cinder, we see the fading of the suns, and try to recall the vanished brilliance of the origin of the worlds."
-Georges Lemaitre
"I fly through hyperspace, in my green computer interface"
-Gem Tos