Proteins of the major histocompatibility complex (MHC) play a central role in the presentation of antigens to the adaptive immune system. The MHC also influences the odour–based choice of mates in humans and several animal taxa. It has recently been shown that female three–spined sticklebacks (Gasterosteus aculeatus) aim at a moderately high MHC diversity in their offspring when choosing a mate. Do they optimize the immune systems of their offspring? Using three–spined sticklebacks that varied in their individual numbers of MHC class IIB molecules, we tested, experimentally, whether allelic diversity at the MHC influences parasite resistance and immune parameters. We found that sticklebacks with low MHC diversity suffered more from parasite infection after experimental exposure to Schistocephalus solidus tapeworms and Glugea anomala microsporidians. They also showed the highest proportion of granulocytes and the strongest respiratory burst reaction, which are correlates of innate immunity. This indicates a strong activity of the innate immune system after challenge by parasites when MHC diversity is suboptimal. Individuals with very high allelic diversity at the MHC seemed inferior to those with moderately high diversity. Such a pattern is consistent with theoretical expectations of an optimal balance between the number of recognizable antigens and self–tolerance.