Spermatozoa live in their own environment in the testicle and only come into contact with the external world when they are ejaculated. They have no contact with the internal circulation of the male body so their superficial antigens are unknown to their immune system (lymphocytes and monocytes).
So spermatozoa develop in their own environment, nurtured independently, behind a barrier which also protects them. However if this barrier is in some way damaged (trauma, infection or inflammation) the antigens come into contact with those immunological cells that normally fight bacteria and infection. In this case the spermatozoa, are not recognized as normal body components and are seen as enemies and attacked. This creates induced immunological anti-sperm antibodies (ASAb) that reduce sperm motility and compromise their ability to penetrate the cervical mucus: hence male infertility.
ASAb can be detected in the seminal plasma or attached to spermatozoa.