From a New Yorker article on tastebuds:
Cocoa was popular long before it was sweetened, and chilies are now eaten by a quarter of the world's adults every day. You can explain this in pharmacological terms (cocoa contains caffeine), in hygienic terms (chilies kill bacteria), or as a function of peer pressure. But the best explanation may be what the psychologist Paul Rozin, at the University of Pennsylvania, calls "benign masochism." We eat chilies, Warheads, and bitter greens, and drink bitter tonics and bitter coffee, for the same reason that we ride roller coasters and watch horror films: to fool the body into thinking it's in danger, and then enjoy the adrenal ride.