Although spices have been important for centuries in food preparation throughout the world, patterns of spice use differ considerably among cultures and countries. What factors underlie these differences? Why are spices used at all? To investigate these questions, we quantified the frequency of use of 43 spices in the meat-based cuisines of the 36 countries for which we could locate traditional cookbooks. A total of 4578 recipes from 93 cookbooks was analysed. We also complied information on the temperature and precipitation in each country, the ranges of spice plants, and the antibacterial properties of each spice. These data were used to investigate the hypothesis that spices inhibit or kill food-spoilage microorganisms. In support of this is the fact that spice plant secondary compounds are powerful antimicrobial (i.e., antibacterial and antifungal) agents. As mean annual temperatures (an indicator of relative spoilage rates of unrefrigerated foods) increased, the proportion of recipes containing spices, number of spices per recipe, total number of spices used, and use of the most potent antibacterial spices all increased, both within and among countries. Likewise, the estimated fraction of bacterial species inhibited per recipe in each country was positively correlated with annual temperature. Several alternative hypotheses were considered--that spices provide macronutrients, disguise the taste and smell of spoiled foods, or increase perspiration and thus evaporative cooling; it also is conceivable that spice use provides no benefits. However, none of these four alternatives was well supported by our data. The proximate reason spices are used obviously is to enhance food palatability. But the ultimate reason is most likely that spices help cleanse foods of pathogens and thereby contribute to the health, longevity and reproductive success of people who find their flavors enjoyable.