If the condition is only slightly harmful those frequencies may even increase. Many had some advantage which kept the gene frequencies up despite their obvious drawbacks. Lastly, it is the interaction or total impact of all the genes in an individual that determines fitness. Genes for mildly negative traits may tag along with little negative selection pressure. It is only the severe autoimmune disease or immunodeficiency disorders that will prove lethal and have little opportunity for being kept.
Allergies are quite mild by comparison.
How allergies develop in an individual is still a very important part of this puzzle. If man-made compounds in any way enhance this process, it would further explain any increases in their frequency. Of course medication helps us cope and minimize the negative effects as well. It seems that evolution has often put up with useless and what we perceive as useless or negative features for other purposes. It is certainly the case that survival of organisms that immune function is required for our survival, and that of many other species.