In a large nonreactive Dutch oven, heat oil over medium heat. Add onion; cook until tender, about 3 minutes. Stir in garlic; cook for 30 seconds. Stir in flour; cook, stirring constantly, for 1 minute.
Stir in stock, tomatoes, sugar, basil, salt, and pepper, and bring to a boil, stirring frequently. Cover, reduce heat, and simmer for 40 minutes.
Place 2 cups tomato mixture in the container of a blender. Secure lid on blender, and remove center piece of lid to let steam escape; place a clean towel over lid to avoid splatters. Blend until smooth; stir purée into soup. Garnish with basil, if desired.