Why do you have to wait to have sex after a miscarriage?

Infection and safety. Initially, pretty much while you are still bleeding and discharging, you are risking an infection. Beyond that you want to be certain that everything has passed and is back to normal. If you were to get pregnant again immediately afterwards the situation not only could be confusing but your risks of another miscarriage are probably increased.
Because cervix dilat. When you have miscarriage your cervix dilate and this means there is increased susceptibility to infection in the uterus.You have to give time for cervix to close.It takes about 1to2 weeks and usually coinside when the bleeding stops as well.