I'm sorry to say that it could possibly have something to do with you. Find and speak with a genetic counselor. They can test you and your DNA for abnormalities. Some abnormalities can make the woman's body fight against the fetus which can therefore end in miscarriage. My heart goes out to you and I hope everything works out for you!
It's easy enough to get a sperm analysis run. You don't have to talk to the doc about getting semi-erect, but if you tell him you're about to get married and have had a couple of girlfriends who had miscarriages and want to rule out anything unusual about your sperm, he will not ask questions about stuff like how erect you get.