The immune system is suppressed during pregnancy. Immunity on the whole is a complex area that still isn't fully understood, especially when it comes to reproduction. But there are some mechanisms that the body has so that the sperm and then the developing baby are not rejected - one of which is suppressing the immune system somewhat so that it doesn't attack the foetus. The placenta produces immunosuppressant chemicals such as progesterone and the structure of the placenta ensures that there is no actual mixing of the mother's blood supply with that of the foetus. The lining of the vagina also ensures sperm does not come into contact with the female immune system.