No, the wine is not supposed to taste like that... it's gone bad. This happens... calm down. Knowing when a wine is faulty is sometimes tricky. Not everyone picks up on faulty wine right away. Everyone's sensitivity level of distinguishing faults vary drastically. Some will be able to pick up on cork taint better than others.
When you're at a winery and suspect it to be faulty, check with the person pouring. In tasting rooms, before they pour any amount of wine from a new bottle, they usually always check it to find any faults themselves. If it is very busy in the tasting room, sometimes a bottle can go unchecked. Be polite though! You're treading on thin ice with this subject. If you accuse a wine of being faulty and it is really just your picky palette, you've just insulted the winery! The way to go about this is simply ask them if it was checked because you pick up a slight fault being whatever. Because we all are sensitive to varying degrees, the person pouring may not be as sensitive as you. If it is, politely pour it out and move on. DON'T MAKE A SCENE.If this happens in a restaurant, immediately inform your server - don't wait until you finish the bottle or they'll just accuse you of trying to stiff them for another bottle. In high class establishments, this check is performed by the sommelier before the bottle even comes to you but it happens, just send it back - A good sommelier will always oblige.
Let's go over some possible faults that can occur:
Corked Wines: "Corked" is the term used to describe the unpleasant odor of wine that has usually been tainted by a defective cork. A cork can be diseased through bacteria or excessive bottle age. A limited amount of cork taint may just dull the wine but not make it undrinkable. However, a wine that sometimes appears corked may merely need to breathe.
"Corked" is not to be confused with "cork residue," which is, literally, small pieces of cork floating in the wine. Apart from being annoying, it is completely harmless.
Oxidized: a wine that has had too much contact with oxygen becomes oxidized and caries with it a foul smell. This can can be caused to poor handling of the grapes after they have been picked, faults in wine making or because the cork has provided an imperfect seal.
Over-sulphured: a wine that smells of burnt matches and leaves a sour taste in the back of the throat. Sulphur dioxide is widely used as a necessary 'disinfectant' in wine-making. Many winemakers now, however, try to use as little sulphur as possible to prevent this occurrence. Today sulphur levels are generally much lower than they were twenty or thirty years ago.
Hydrogen-sulphide: the rancid, bad egg smells that come from winemakers not paying sufficient attention during fermentation. Equally, they can occur if the wine has not been racked adequately while it matures.
Unclean barrels ('barrel taint'): can give wine a musty nose and taste which is often very similar to a corked wine. Barrels, especially any that are empty for a long period of time, have to be kept incredibly clean to avoid tainting the wine. Whenever possible, winemakers try to keep their barrels full with wine.
Acetic acid: common to all wines. In excess it will make the wine smell and taste vinegary.
Your senses are your best defense - your nose and taste in particular. If the wine carries sherry-like, mold, musty, or even rotten eggs smells - proceed with caution! If there's any doubt in the smell, your taste buds will confirm any hesitations.
Fortunately, nowadays, faulty wine is somewhat of a rarity. Today's improved wine production techniques and increased attention to detail regarding bottling and storage have gone a long way towards eliminating the possibility of purchasing a faulty bottle of wine... but it still happens.

