Women, as far as I have read, mount a broadly stronger immune response – greater antibody responses than males, higher basal immunoglobulin levels and more B cells. It's complicated though as a number of key immunity-related genes are located on the X chromosome (indeed, the X is a significant determinant of autoimmunity, karyotypes with multiple X chromosomes typically result in a significant propensity toward autoimmune diseases). Also the X chromosome contains around 10% of the machinery that determines which other genes are expressed and these work in concert with a number of sex and other hormones. In men, X chromosome effects are relatively simple, they have only the one. Women have two, which means (nearly) every cell in a woman's body has to silence one of the X chromosomes, and it may be one of them, or it might be the other – so all women are chimeric. Of course, there's the entire foetus thing, which entails massive adaptations though the core one is maintaining physical separation (most animals achieve this by the females laying eggs and effectively air-gapping the entire shebang). The placenta is an amazing and complex organ. That said, it may be that when you are around eight month's pregnant, the egg-laying alternative might sound appealing. Evolution, eh?
Of course, all this is modified by environmental influences and the microbiome. Tldr, it's complicated.