I agree check for vitamin mineral issue. Your horses may be eating the clay to add digestive micro-organisms, to sooth upset stomach (clay has an absorbant action), out of boredome or habit or mental disease. I would be concerned if sand was aslo in your dirt as it can cause sand colic or impactions.
I am leaning towards lacking a mineral in the diet.
I feed the loose minerals-so they can get the minerals they need without having to consume way too much salt from those hard blocks.
You see deer and wild hogs do that out in the woods sometimes. They are attracted to natural salt/mineral deposits