Why do you have to have 2 weeks of pelvic rest after a miscarriage?

Pelvic rest. You need time for your uterine lining to heal. Early intercourse could can result in an infection. I usually suggest waiting till you get a period after your miscarriage.
Six weeks. You want your cervix to close up completely after a miscarriage. Six weeks is typical.