The traditional explanation is that you taste the wine to make sure it's not corked, but this explanation never made a lot of sense to me. First of all, wine doesn't get corked all that often I've received corked wine maybe three times in years of eating at restaurants. Second, you could figure out it was corked after it was poured. Why the necessity to taste it first? And third, waiters go through the tasting ceremony even if it's a screwtop bottle or plastic cork, which means the wine isn't going to be corked.
But I recently came across an alternative explanation in Benjamin Walker's Encyclopedia of Esoteric Man
'tasting' used to be the common preliminary rite in ancient times. Generally the first drink was taken by the chief of a tribe because he had to be served first as the representative of the god. It also symbolically lifted the taboo that prohibited drinking on ordinary occasions, and neutralized the mana that inheres in sacramental drinks. It was also an assurance to guests that the drink was not poisoned.
Even today in western society the man ordering a bottle of wine for his companions, or offering wine to guests, often has the first sip from his glass and then has the other glasses filled. This is a survival of the old 'tasting' custom, by which the host 'approved' the drink, and ensured that it was free from poison. In Moslem countries the ruler had an official taster, and only after he had tried the sultan's food and drink in his presence without ill effects, did the latter partake of them himself.
I have a hunch Walker is right that there's nothing very rational about wine tasting in restaurants. It's just long-established ritual. But, of course, there are all kinds of odd customs and superstitions associated with wine, so that shouldn't be too surprising.