There's a lot of good answers here, so let me focus on the part that's mostly omitted.
A huge chunk of the food we eat is spoiled. Intentionally. The reasoning for each is very wide, from preventing harmful spoilage (food preservation), to improving taste, texture etc.
The most obvious of those foods are of course cheeses and yoghurts. Even the simplest cheeses can be considered "spoiled" - they were made by exposing milk to stomach enzymes. "Cultured" cheese include either molds or bacteria on top of that. Yoghurt depends completely on introducing bacteria to the milk. Knowing this, claims of "antibiotics in milk" are pretty absurd, heh? :) Note that before you get used to eating (a new kind of) cheese or yoghurt, a lot of your safety systems are screeming "don't eat that smelly, ugly, bad-tasting stuff!". In fact, smelliness is a great indicator of spoilage (it's one of the principal uses of smell in humans, unsurprisingly). What it can't detect is whether the spoilage is actually harmful.
Hams are an often overlooked example. They usually don't have any bacterial cultures added during production, because they're quite fine with what they already have. The key part is adding salt. Unlike what you might have heard, salt doesn't kill bacteria. In fact, there's a nice little bunch of bacteria that quite like salty meat, you might have heard of those - lactobacilli. The reason salt can be used to preserve meat is that it causes the bacterial growth in the meat to balance heavily in favour of those lactobacilli, which are harmless (and in fact, beneficial) to us. Other cultures, some of which may be harmful, find themselves unable to compete, so their numbers stay relatively low.
If you go further, even bread can be considered "spoiled" to some extent. Its production depends heavily on enzymes and micro-organisms that break down the starches in wheat and rye. Apart from yeasts, you will also find our good old friendly lactobacilli responsible - in "natural" sourdough bread, the lactobacilli predigest the dough for the yeasts, or (especially in rye bread), they are responsible for pretty much the whole leavening.
Alcoholic beverages can also be considered a spoiled food. Like bread, they are made through fermentation of fresh (or even pre-spoiled) food, changing the sugars in the original fruits (or e.g. grains) into ethanol and various other byproducts. Not to mention that it also loses a lot of its micro-nutrients, a common consideration in harmful spoilage.
Many local delicacies tend to include spoilage - basically, any time you eat some delicacy that smells awful, it's probably (controlled) spoilage. For example, Olomoucké tvarůžky, a very bad smelling kind of Moravian cheese, actually use the same bacteria that causes smelly feet. You will find the same in many traditional wines as well (remember the part where people crush the grapevines with their bare feet? Yum, yum, right? :P).
So, what kind of spoilage you should always be critical of?
- Molds are generally dangerous, and may cause chronic, incurable diseases; unless it's a cultured mold (e.g. moldy cheese), stay away. Cooking the food will not help, since the harmful part usually aren't the molds themselves, but rather the toxins they produce - those will not disappear through cooking. Cutting out the moldy part will usually not help either - by the time you can see the mold, it's usually grown all the way through the whole food.
- Anything with eggs or poultry. You really don't want Salmonella, it's really ugly. This of course includes stuff like dressings, mayonaisse and similar. Just stay away. If in doubt (as in, I've had those eggs for a while, but they don't show any visible or smellable sign of spoilage), make sure you cook the food thoroughly. Using such eggs in a baked meal that's been in the oven for hours on 70-90°C is probably fine. Using them in e.g. scrambled eggs is a bad idea. Using them in mayonaisse is just asking for trouble.
- Food left in contact with the ground, especially when left out in the sun.
Humans are actually pretty tolerant to lots of different kinds of spoilage, but unless you're actually used to it, it's pretty risky.
But even for other spoilage, always treat food that doesn't smell or look good with suspicion. If you insist on eating it, try a very small portion first - amount is a huge factor in a lot of the bad stuff that can happen to you. However, as @rumntscho noted, this is far from fire-proof - a lot of infections and poisonings can take time to manifest, and you might not even notice trouble in a small dosage.