I would find out how many calories per day your body needs when pregnant and then use up those calories with healthy foods. That way youll only gain the weight thats needed and not any excess.
There needs to be weight gain in order for a baby to thrive in utero and also to produce milk to breastfeed