Because it is there
The uterus is a structure that many consider internal, but it is really open to the outside through the cervix & vagina.
Germs that hang out in the vagina & the others contributed through sex
are all potential agents that could enter the uterus and cause infection. Germs go where there is mucus and other tissues to feed on. The uterus is full of them.