Rhogam after 2nd mc but not 1st?

Ing • 🌧7/30/17 🌧12/30/17 🌧3/22/18 🌈 👶🏻 5/22/19

I am at the end of my 2nd miscarriage (just spotting) after about 5 weeks 1 day. I had the doctors appt today and they did some blood work to check my hcg and progesterone levels and she said I have to get a rhogam shot. I asked if I should have had one after my first miscarriage at 4 weeks 6 days and she said probably. Could this have caused the second miscarriage? I'm just so frustrated with this provider and will be looking for another but just wanted to know if getting rhogam is normal after mc? And is it ok I never got it after the first time?