It's even more important for legumes and other foods because it removes phytic acid (one of the things that prevents absorption of nutrients/minerals) and makes it easier to digest. It's similar with nuts too. They all become nutritionally more accessible (and "richer") when soaked and the soaking water is later thrown out (before cooking).