What glasses are meant for which beers and why? I know there are already one or two questions that touch on specific beers. However, I would like more of a comprehensive list. I would also like to understand why those types of glasses are chosen. Is it for head retention? Breathability? Appearances?
Function

Beer glassware serves a few primary purposes:


it is part of the branding of the beer (for beers with their own glass)
it presents the beer (beauty is in the eye of the beer holder) showcasing the beer's color, clarity and/or carbonation.
it influences how quickly volatiles (aromatics) are released
it influences how much beer can be consumed per sip (e.g. compare champagne flute vs. beer mug)
it can promote head retention (through the shape, plus small etchings in the base of the glass)


Some examples


A Pilsner glass is a long tall V-shaped glass. It emphasizes the
color, clarity and effervescence of the Pilsner. It's similar in
principle to the fluted champagne glass, but having larger rim,
affords larger sips.
The traditional mug is a robust glass, primarly aimed at "chinking"
glasses together and allowing large swallows of beer. 
The challace/goblet can be beautiful pieces of work, designed to
showcase the beer, and also promote and maintain a large head. 
The tulip glass captures volatiles (in the narrow part of the glass)
while the large opening at the top supports a large head.
The Sniffer, typically used for cognac/brandy, but also for very
strong ales, has a large base that curves up to a small opening to
capture the aromatics, and to allow for swirling to encourage more
aromatics to be released.
The Stange, a long tall glass, amplifies the malt and hop
characteristics by concentrating them in a smaller area, while also
providing a simple elegant presentation of the beer. Often used with
delicate beers.
The Weizen glass is similar to the pilsner glass, but larger
(typically 0.5l minimum) with plenty of room for the large head
typical of a wheat beer.


For more details and images, see Glassware for Beer.