Enclose the cinnamon, celery seed, pepper flakes, cloves, and allspice in a tea ball or cheesecloth pouch secured with twine.
Pour the vinegar into a one-quart saucepan and add the spices. Bring to a boil over medium-high heat; then cover the pan and turn off the heat.
Put the tomato purée and onion in a heavy-duty four-quart pot. Bring to a boil over medium heat.
Lower the heat to medium-low and simmer, stirring frequently to prevent scorching, until the onions are very soft and the flavors are melded, about twenty minutes. If you want very smooth ketchup, you can pass the mixture through a food mill at this point to purée the onions.
Remove the spices from the vinegar and add the vinegar to the tomato mixture.
Add the sugar and salt and stir well.
Continue to simmer until the ketchup is thick enough to spoon but still runny enough to pour, about sixty-five minutes.
Cool to room temperature and then refrigerate. The ketchup will keep for about two weeks.