The cells are foreign to their system and are therefore destroyed. It might seem odd but remember that evolution is not a perfect system. And traits that can be good in one regard might have some other downsides.
Obviously, it is good that a woman’s immune system attacks foreign bodies as that keeps her fit and which increases her chances of procreating. A+ for evolution.
However, that means it kills sperm cells too. But at the same time, sperm cells are numerous. So there will always be a few that make it past anyway. So even if it is not perfect, the system works.
Also, it ensures that strong, healthy sperm have the best chance of getting to the egg.