Eating of non-food items is medically called PICA. Sometimes the pregnancy places stress on the mothers reserves of certain minerals. As a coping mechanism the mind can lead the woman to look for sources of the minerals eg iron or calcium. When a source of this is found, the person may feel an uncontrolled desire to eat the said source. If the source is in soil then you will find the person developing a constant desire to eat soil.
It is important to note that eating soil is not healthy as it may contain eggs of parasitic worms and additionally it fills the stomach with non food items leaving reduced space for actual food.