Our body, too, can do some clumsy and painful things. But sometimes we discover (or hypothesize) that … oh. We meant to do that!
I just found out that my penicillin allergy is totally on purpose. Well, maybe. The idea goes that allergies protect us against toxins: all the reactions (think runny nose) are attempts to expel the offending toxin from our body, and thereafter we avoid the thing that made us feel so bad. I have a nut-allergic friend who, no joke, avoids butternut squash because of the name.
As for penicillin: the allergy that I share with my son may not be an immune system screw-up, but an attempt to protect us from toxic haptens, formed in our bodies from the penicillin molecule. People who make very few of those haptens don’t have to worry about it; he and I, if the hypothesis is correct, make more than usual and the allergy is our damage control.