I agree with Newflvr that teaching "leave it" is very important and that you can use it to tell him what to not to touch/eat (such as soil). I would also suggest that you teach "take it" at the same time. That way, your pup not only learns to leave things alone on command, but they get into the habit of not taking things without permission.
Another thing That I would suggest to you is to spay the dirt with bitter apple spray. Most dogs HATE bitter taste, so bitter apple spray, which is usually used to prevent chewing, should make the soil unappetizing.