We're pretty sure he just lost himself in the moment, and he was sincerely apologetic .... but yeah, of all the things he could have chosen to make a joke about, that's what he chose.
To be clear, he didn't make fun of my nephew, but singled him out by announcing to anyone within earshot "we have an allergy", he then yelled to ask a hostess if she had eaten any nuts that day, and when she replied yes, his punchline was "well, no kissing this kid then". (Honestly, it seems worse in type than it was, but we were all definitely caught off guard.)
That said, in terms of actually dealing with my nephew's order, the server was very on the ball and courteous (as was every other server we encountered).