A longitudinal study found that people who ate spicy food more often were less likely to die over a seven-year period. At The Washington Post:
This is a highly credible study because of its size, with half a million participants, and its duration, with some participants recorded for as long as ten years. However, the mechanisms by which spices are associated with better health are not known.
The researchers speculated about a link to capsaicin, the primary cause of the hot effect of peppers and several other spices. One possible mechanism could be that capsaicin and other components of spices might kill fungi, bacteria, and other parasitic organisms inside the human body, but even this obvious theory has not been well studied. Capsaicin and curcumin, another common spice component, have antioxidant effects that have been measured, and peppers contain other known antioxidants, including vitamin C. The antioxidant effect might provide part of the explanation. Another possibility is that the nutrients in peppers and other spicy vegetables, which include vitamins, minerals, and enzymes, are an important factor. But the answer could also be as simple as hydration, if spicy foods prompt eaters to drink more water.