Since forever I've been telling people that they should let their kids go out and play in the dirt. In the case of very young kids, this will likely include ingesting some of it. My position is that the immune system is like any other system in that you either use it or you lose it, which manifests itself in the form of asthma and other diseases of the habitually sterile.
Now there's a research study from Australia suggesting that a bacteria commonly found in dirt can actually make you smarter as well.
Little girl: "Have one of these cookies I just baked."
Little boy:" This cookie tastes like dried mud."
Older child, to boy: "See, you're getting smarter."
H/T to Bayou Renaissance Man for this one. The rest of his article describes a technique from Africa to 'replant the garden' as it were, of a depleted supply of intestinal flora.