Reading the following study, I thought to myself - OK, once again someone is testing a supplement, but generally studies find that supplements don't do as well as real, actual foods in whatever is being tested. In this case, a supplement containing lycopene, which is found in tomatoes, was tested by researchers in the UK to see if it would help with sperm quality in men. Other studies have found dietary lycopene to have health benefits (e.g. lower incidence of lethal prostate cancer), which is among the reasons the researchers focused on testing it for semen quality.
The study design was nice - with 60 young healthy men randomly assigned to one of 2 groups - the supplement group and the placebo group, and no one knew who was assigned to which group (double blind). They took either the lycopene supplement (14 mg/d of lactolycopene, equivalent to 2 kg of cooked tomatoes) or a placebo for 12 weeks. They found changes in sperm quality after the 12 weeks, with significant improvement in the proportion of "fast progressive sperm" and normally shaped sperm (morphology). However, "motile sperm concentration" (the number of moving sperm) did not improve - and this is considered the main measure associated with chance of conception. So it is unknown how the 2 things that improved would affect fertility.
Bottom line: Studies find numerous health benefits from diets rich in fruits and vegetables, including tomatoes and other red foods, such as watermelon, papaya, and pink grapefruit. And yes - ketchup is a good source. Apparently more lycopene is bioavailable when tomatoes are cooked or processed, especially when cooked in oil (as compared to raw tomatoes). And when eating fruits and vegetables, try to eat as many that are organically grown, because eating fruits and vegetables with high levels of pesticide residues has a negative effect on sperm quality.