White foam when boiling presoaked beans
The foam happens because legumes are rich in saponines (see my longer answer here). It contains nothing more and nothing less than the water in which you boil the beans, it just happens to trap air bubbles because of its physical properties. 

There are no specific culinary reasons for or against keeping the foam. If it is in the way, you can remove it, but nothing bad is going to happen if you keep it. It is not much of a waste anyway, as a large volume of foam contains a very small amount of boiling-water-solution per weight.