Step 1: A D&C breaches the cervical barrier and disturbs the endometrium, so any state where this would seed or spread infection is the danger.
Step 2: Active pelvic inflammatory disease is exactly such a state; passing instruments through an infected lower tract drives organisms into the uterus and tubes, so the procedure is withheld.
Step 3: Endometriosis does not carry this infective hazard, and ectopic pregnancy is managed by other means rather than being a classic D&C contraindication. PID stands out as the contraindication.
\[\boxed{\text{Pelvic inflammatory disease (PID)}}\]