The sugar helps to balance the acidity of the tomatoes, giving a more rounded flavor to the dish.