There was universal agreement that the wine needed to breathe. A friend and I felt that at least twenty minutes (perhaps more) was needed for the wine to settle down. Our waiter, obviously anxious to empty the bottle and have us open a second bottle, grabbed one of the filled glasses on the table and began to swirl the wine vigorously. He kept at this for what seemed for several minutes (it was probably less, but time seemed to stand still). He then presented the wine to my friend and viola! it was much better.
As some of the posters noted above, there are several reasons to decant. In the case of vintage Ports, you want to remove all the sediment. Not much other wine has so much sediment but that's not the only reason to decant. You decant a young wine to aerate it. You decant other wines so that they can blow off the bottle funk.
So what happened with your wine? The bottle is sealed. There is limited, ideally no, oxygen. So the reactions in the bottle are reductive in nature. You can measure them as a electric charges actually - the reduction/oxidative or redox potential. Some people say that the corks let a small amount of air/oxygen into the wine. Of course they never know exactly how much and it's basically a mistake - the best corks seal the wine so you end up with reductive reactions, but that's fodder for a different thread.
The wine contains sulfur compounds naturally plus sulfur is also added to prevent oxidation, but sulfur can make stinky compounds. So when you open the bottle, you smell the "funk" which is most likely some sulfur based compound. This "blows off" in time. Actually what happens is that they react with the oxygen in the air and form different compounds that are still in the wine but you can't detect them as readily.
Anyhow, what happens when one does a "hard decant" or aerates the wine as the person did in your case, swirling it vigorously, is that some air, and consequently oxygen, is incorporated and the sulfur compounds react with it and the wine seems friendlier and smoother. It's not the same thing as aging, but it works in a pinch when you opened young wine.
That is distinguished from swirling in your glass to disturb the wine and to release some of the volatile compounds so you can smell them. In that case, crazy swirling is counterproductive. But if you have a young wine and you incorporate air, it can seem "smoother".
It's why some people shake the hell out of a bottle. Pour off some wine, put the cork back in or use your thumb, and shake the bottle up. It's what your waiter did, only more drastic.
Old bottles are different. I would be unhappy if the waiter did that to an older bottle at the table. Those bottles have had no oxygen for a long time and it's almost like waking them up when they get some air. But sometimes you only have a brief drinking window before they start to deteriorate, depending of course on the wine and the year.