I also gained weight after my first miscarriage and was told by friends that that was common so I didn't think much of it. Then I had a second miscarriage 6 months later and gained more weight. I was told there were several reasons - hormonal imbalance, body/mind still thinks I'm pregnant so I'm gaining pregnancy weight, etc. I kept exercising and dieting, but nothing worked.
I talked to my OBGYN and she referred me for testing, then to a reproductive endocrinologist, and then I FINALLY had a medical answer - the pregnancies and miscarriages also exacerbated a thyroid condition. For me, the thyroid condition probably contributed to my miscarriages as well. Either way, I'm on medication and starting to slowly lose weight again. Hopefully I'll be back down to a healthy weight by the end of the year so I can try to get pregnant again!
It could be your hormones still adjusting, it could be psychological, or maybe your body is telling you that it needs a few extra pounds to handle the pregnancy. But it can't hurt to have a conversation with your doctor about your frustrations and maybe have some testing done.