Sex during first trimester

During my first appointment my doctor recommended no sex but didn’t give an explanation.. I’ve read online and there is some literature saying women who have had multiple miscarriages shouldn’t have sex during the first trimester. Can anyone help me out here ?

I’ve had two MC previously and both AS SOON as I tested I started spotting. I was told by many people that spotting during what would have been your cycle is normal for your first cycle after getting a positive but unfortunately both times I started miscarrying as soon as I found out I was pregnant. This time is completely different. No spotting AT ALL, 2 weeks post positive test, HCG is doubling so it this just to be super cautious or ? The other times we hadn’t had sex either due to the spotting

TIA