It is easier to target women than men with a virus
Viruses are not actually unique organisms, but rather, the result of broken strips of the host organism'sspecies's own DNA wrapped in proteins that behaves maliciously towards the host when separated from the rest of the chromosome is normally exists onit replicates from. Male
Male and Female DNA is identical except for the X/Y chromosome. Male DNA is missing a piece of genetic code that Female DNA has; so, if a virus were to originaterequire something from this missing section of DNA, then it would be 100% harmless to men, but would attack women.
But a retrovirus could attack only men
The vast majority of viruses attack DNA, but there is a small subset called retroviruses that specifically target RNA. Because males and females both have unique forms of RNA, it is theoretically possible for a retrovirus to attack just male RNA. That said, retroviruses are far less common in humans than DNA viruses. Out of the 219 known viruses that affect humans, only 5 are retroviruses, and all of them affect women more than they affect men. So, male specific viruses are theoretically possible, but nature tends to swing in the other direction.
A Male specific Bacteria, Fungus, or Parasite is much more plausible
There are enough minor differences in males and females that an actual organism would be far more apt to thrive in a host of one gender or the other. Again, most infectious diseases affect both genders pretty equally; however, there are certain immune responses that exist wholly on the X chromosome making the female immune system is a bit more robust over all. So, while it is unlikely for a disease to just affect men, it is very possible that a particularly bad disease could do something like kill 99% of men and only 95% of women leaving a highly gender skewed population behind.