The reason why cats lick soil may be because they have a behavior called "licking syndrome". This behavior may be caused by their need to take in minerals or lack of certain nutrients. They may also be doing it to clean their claws or teeth, or to get rid of odors. In addition, cats may lick dirt in search of water. In the wild, cats look for water in the dirt to drink, so they may also lick dirt in the home looking for water.
If your cat licks dirt frequently, it is recommended that you take it to the veterinarian to determine whether it has some kind of malnutrition or other health problems question. Also make sure your cat has enough water and nutritious food.