One just has to look at various traditions across cultures concerning pregnant women and new mothers to come across a massive lists of things you should and should not eat and things you should and should not do.
My guess is that human society has always seen pregnancy as mysterious and dangerous and very necessary to the continuation of the society. Thus, society has always told pregnant women and mothers all sorts of advice/rules about things that they thought would decrease the risk to mother or baby. This has continued into the scientific era, where people try to have at least some scientific backing for the advice.
Many times, the modern scientific advice is much less restrictive than the traditional, non scientific advice with regards to what can be eaten and what activities may be undertaken while pregnant.