Mating plugs in animals are ubiquitous and are commonly interpreted to be products of mating strategies. In spiders, however, mating plugs may also take on functions beyond female remating prevention. Due to the vagaries of female genital (spermathecal) anatomy, most spiders face the problem of having to secure additional, non-anatomical, protection for transferred sperm. Here, we test the hypothesis that mating plugs, rather than (or in addition to) being adaptations for mating strategies, may serve as sperm protection mechanism. Based on a comparative study on 411 epigyna sampled from 36 families, 187 genera, 330 species of entelegyne spiders, our results confirm the necessity of a sperm protection mechanism. We divided the entelegyne spermathecae into four types: SEG, SED, SCG and SCD. We also studied detailed morphology of epigynal tracts in the spider Diphya wulingensis having the SEG type spermathecae, using 3D-reconstruction based on semi thin histological series section. In this species, we hypothesize that two distinct types of mating plug, the sperm plug and the secretion plug, serve different functions. Morphological details support this: sperm plugs are formed on a modified spermathecal wall by the spilled sperm, and function as a temporary protection mechanism to prevent sperm from leaking and desiccating, while secretion plugs function in postcopulation both as a permanent protection mechanism, and to prevent additional mating. Furthermore, with the modified spermathecal wall of S2 stalk, the problem of shunt of sperm input and output, and the possibility of female multiple mating have been resolved. Variation in spermathecal morphology also suggests that the problem of sperm protection might be resolved in different ways in spiders. Considering mating plugs of varying shapes and origins in the vast morphospace of spiders, we conclude that mating plugs might serve different purposes that relate both to mating strategies, as well as to sperm protection.