It shouldn't get to the point where it develops a foam, unless of course we're talking about a hot break foam. If it's foaming, it's on the verge of boiling over. Starches (and potentially other stuff) in the wort cause water vapor to form into bubbles at the surface. If new water vapor bubbles are being formed at a rate faster than the old ones are popping, a foam will build up and eventually boil over. Even if you keep it from boiling over, a thick layer of bubbles can push the hops out of the wort and onto the sides of the kettle above the surface, preventing the important parts of the hops from being extracted into the wort.
Ideally, you want a rolling boil, where there is a steady stream of large bubbles disturbing the surface of the wort, but no foam.