Wash tomatoes. Dip in boiling water 30–60 seconds or until skins split, then dip in cold water. Slip off skins, remove cores, and quarter.
Add onions and ground red pepper. Bring to a boil and simmer uncovered 20 minutes. Cover, turn off heat, and let stand 20 minutes.
Place cloves, cinnamon, allspice, and celery seeds in a spice bag; add to vinegar, bring to a boil, then remove the spice bag.
Combine spiced vinegar with the tomato mixture and boil about 30 minutes. Press through a food mill or sieve.
Return to pot, add sugar and salt, and boil gently while stirring frequently until volume is reduced by half or ketchup rounds up on a spoon without separation.
Fill hot pint jars, leaving 1/8-inch headspace.
Process pints 15 minutes at 0–1,000 ft, 20 minutes at 1,001–6,000 ft, or 25 minutes above 6,000 ft.