Seeds are very precious to the plant - it's the plants 'baby' and so it requires protection. In order to survive insects, heat, cold, bacteria, and animals, seeds often contain a variety of anti nutrients, natural pesticides and toxins as their form of self defense.
Grains and beans are particularly high in these anti nutrients, which may be why they are poorly tolerated by many people. Antinutrients may impair nutrient absorption - for example. preventing your absorption of iron and calcium.
Examples of antinutrients in phytic acid, lectins, glucosinolates, trypsin, tannins, goitrogens, oxalates and gluten (a type of lectin).