Why is it important to have foam on a beer? I've seen people complain when served a beer without foam. Equally, getting a glass full of foam is no use.

When serving a beer, how much is the right amount of foam and why is this important?
Most importantly, a good head helps release the aromas of the beer, especially the hops. Aroma is everything for enjoyment of a good brew. When enjoying a super-hoppy IPA, you should always use a glass that provides a large surface area for aromatics to rise from.

It can also provide the a pleasant mouth feel. Stouts definitely benefit from a thick, silky head.

And lastly, it's eye candy.

As for the right amount of head, it varies. Generally in an average pint glass you want 1-2 finger-widths of head. Some hefeweizens and wit beers are best with a bit more.