These three flavors play a crucial role in many of the beverages we consume, and are often confused. All three are essentially defense mechanisms that plants have developed to fend off predators and parasites. Now, ironically, many plants are used precisely because they have high levels of such flavors—a testament to human perversion. But these flavors are not unequivocally desirable or undesirable. In certain contexts they're highly valued, while in other contexts they're considered flaws. In some cases certain types of acidity or bitterness are desirable, while other types are undesirable.
Bitterness is one of the four traditional basic tastes. Since many toxins are bitter, aversion to bitterness confers evolutionary advantage. Beer is one of the few beverages in which bitterness is valued. (Many cocktails also rely on bitterness.) Hops contain compounds known as alpha acids that, when isomerized by boiling, are highly bitter. In low concentrations, this bitterness balances the cloying sweetness of unhopped beer. (Beer is generally sweeter than wine, because barley imparts more unfermentable dextrins than grapes do.) In higher concentrations, this bitterness becomes a powerful, lingering sensation that many Americans have become enamored of. Very bitter beers like American IPAs are off-putting to the uninitiated, but for hopheads, there's no substitute. Other natural sources of bitterness include cinchona bark (quinine), orange peel, artichoke, cascarilla, and many more.
Acidity is a prized attribute in wine, coffee, and certain styles of beer. One of the reasons acidity is so desirable is that, when combined with certain aromatic compounds, it evokes flavors of fruit, nature's only dessert. Acidity also provides a crisp, refreshing quality, and balances out sweetness that would otherwise be cloying—which is why soda is usually dosed with citric or phosphoric acid. However, perceived acidity does not always track pH. People often talk about coffee as being highly acidic, but it only has a pH of ~5, on average. For comparison, that's about the same pH as black tea. A typical beer has a pH around 4, even though beer is not usually thought of as an acidic substance. Wine and sour beer sit in the 3 - 4 range, and anything below 3 isn't something you'll want to consume straight. The main acids found in beverages are citric (lemon), malic (apple), lactic (yogurt), tartaric (grape), acetic (vinegar), and phosphoric (cola), each of which has its own flavor.
Astringency is not traditionally classified as a taste, but as a tactile sensation. The source of astringency is a group of compounds known as tannins, which are a type of polyphenol. When tannins come into contact with proteins, they bind them together. When this reaction occurs in your mouth, it results in a dry, parching sensation. In tea and wine astringency can provide a sense of body to an otherwise thin liquid. Adding milk to tea reduces its astringency, because the tannins in the tea will bind to the milk proteins, meaning there are fewer unbound tannins that can bind proteins in your mouth.