What is the purpose of the sugar in ketchup?
High fructose corn syrup is a preservative. While sugaring your ketchup is good for flavor, HFCS is great for shelf stability, as is the vinegar. 

The reasons you typically see HFCS in American Ketchups is that it is (1) heavily subsidized and domestic and cheap, (2) farmed by the same companies making the tomatoes, and (3) a preservative. Also, it helps to improve flow while maintaining viscosity.

Sugar generally can be used to cut the acidity in a tomato dish without inhibiting the taste or outshining the tomato. My stepfather had digestion issues with high acidity meals and swore by a teaspoon or two of sugar to help aid the stomach issues. Likewise, the acidity of ketchup may well be mitigated by all the sugar.