There's no denying the appeal of a tall glass of sparklingly clear beer, and brewers work hard to achieve crystal clarity in their products. But cloudy beers are not only fairly common in the craft beer world, sometimes haze is desired and developed in certain styles. Other times the haze is a harmless aesthetic flaw, and in rare cases haze can be a sign of a bad beer.
The most well-known hazy beer is the German hefeweizen, which literally translates to "with yeast." The special yeast strain that gives the Bavarian wheat beers their signature aroma of banana and cloves is known for remaining in suspension long after fermentation is complete. The residual yeast clouds the hefeweizens, and is a desired quality of the style. Hefes also contain a high proportion of wheat malt, and the high-protein wheat adds to the formation of haze.
Another wheat-heavy brew known for its cloudy appearance is the Belgian witbier, and brewers have traditionally added a quantity of uncooked flour to the brew to emphasize its pearly haze.
This protein haze is common in beer, and it is a result of the brewing process and won't affect the flavor or aroma of the beer. Sometimes the haze is only visible when a beer is between 32 and 68 degrees. You can even watch this "chill haze" disappear as a beer warms. Brewers use a variety of equipment and extra ingredients to filter or fine this haze away, but the most effective methods can have an adverse effect on a beer's head, and a brewer must balance a beer's clarity with the desired level of foam formation and retention.
The pungent hops so popular with American craft brewers can also be at the root of hazy beers. Polyphenols found in hops can bind with oxygen or minerals in a beer to create the haze, and this is particularly common in heavily dry-hopped or unfiltered brews. Again, it doesn't affect the flavor of a brew, and some heavily hopped IPAs can even have small hop particles floating in the beer.
One form of haze that does negatively affect a beer's flavor is caused by microorganisms. A brew that's been infected with bacteria or wild yeasts can exhibit a "biological haze" that can also cause the brew to taste sour, buttery, or worse. Dirty tap lines are the most common cause of bio-haze in craft beer, and a brew that tastes funny (metallic, buttery, or sour) and is cloudy should be sent back (it won't hurt you, but it's gross.)
Old beers can also develop a haze as proteins precipitate out due to oxidation over long periods. Particularly old examples may have small white flakes floating around, and these brews can taste waxy or papery.