It is rare for it to occur, but yes, I am proof that a vaginal infection will end a pregnancy. BUT, it wasn't a miscarriage.... It caused labour and I delivered a live baby girl at 23+3. She died 40 minutes after birth.
The mechanism is this... There is bacteria inside your vagina, and there is bacteria on your skin around your anus, vagina etc... Things can get thrown out of balance in your vagina if bacteria enters your vagina from the perineal area. This can happen in a variety of ways... When a Dr does an internal exam, she is wearing a glove, but she can still push bacteria from outside, from your own skin, into the vaginal canal. Same with an internal ultrasound probe. Sex can cause the same thing, and if you have to insert anything into the vagina (IE/ progesterone suppositories, Canestan, whatever...), you run this risk whether you wear gloves or not.
Now, in healthy people, your own bacterial flora inside the vagina will take care of this. And yes, most people have a good plug and a good cervical length, and these combined act as a barrier to any bacteria trying to ascend.
But then there is someone like me. And I probably make up the top 1% of complicated obstetrical cases in BC (or so BC Women's have told me). The mechanism for me was this. I had a McDonald cerclage placed at 14 weeks. Everything was fine, and in stasis for weeks. There would have been some slight inflammation around the stitches, as your body will do that around anything foreign. But in itself, it was behaving fine. Then my Dr did an internal exam. And she was very vigorous, moving her fingers around quite hard etc. And then she did the internal ultrasound, and once again, she was very vigorous. Now, not only did she push my external bacteria into my vagina, but she further irritated the stitched off area. So add bacteria to an inflamed, possibly weeping area, and you have a bad situation. Add that to the fact that I was inserting prometrium suppositories into my vagina twice daily... and basically it created a perfect storm inside my vagina.
Now... add this to a Dr a who didn't believe I had an infection! I had my exam on Wednesday, and by Friday I was exhibiting signs of an infection. I went to an ER on Sunday, (it was a long weekend, and Drs weren't in clinic until Tuesday). The ER Dr said he didn't think I had an infection, and prescribed Flagyl only under duress from me, but she told me NOT to fill it until swabs came back on Tuesday. I had an appointment with my GP on Tuesday, he said I didn't have an infection, and told me NOT to take the medication. I went back on Wednesday, he still said I DID NOT have an infection. I ended up in the ER early Thursday morning, and my GP was on. I now had a pink and grey thick discharge. He finally agreed I had an infection. So this infection had a week to incubate.
I started oral antibiotics, when I should really have been on IV antibiotics. It was too late. The infection caused my cervix to weaken and dilate. Within 24 hours my cervix was gone (it started out at 3.2cm), and I was dilated to 1cm with membranes bulging, and I was in labour. I now had no barrier between the sac and the infection. The next day the infection burst the sac and entered inside. At this point the labour could not be stopped, nor would they try, as both me and Devon were in danger. When I delivered I was highly infected, as was Devon, as well as any remaining fluid, the tissue of the gestational sac, and my uterus was infected as well.
So yes, it does happen. But you can see that in my case, there was a lot of stuff that was done wrong, and I had the extenuating circumstance of already having a foreign body inside the vagina (the cerclage).
So yes, for this pregnancy, there is a nothing in, nothing out policy. This is to protect me and the baby. I am on daily antibiotics, and I am not allowed to have baths, just showers. I have not had any internal exams or scans, and after having my Sharodkur cerclage placed, I did a one week course of antibiotics to protect me.
I am, however, a complicated obstetrical case. For the vast majority of people, external bacteria inside the vagina, is not going to cause an issue. And yes, a post mortem on the placenta said it was Bacterial Vaginosis.