I remember when I was a very young child - more than half a century ago - getting into trouble for eating dirt. I was amused more recently to hear about my nephew doing the same thing. It seems, from my point of view, to be instinctive. I wonder why?
don't little kids sometimes eat play-doh, bugs, crayons, etc? new experiences/curiosity i'd imagine
Bored? Low on minerals? Too many parasites?
Dogs do this instinctively too when they might need something from the dirt.