Heat the olive oil in a large skillet over medium heat. Add the onions, the garlic, red pepper flakes, and sugar and season with salt, to taste. Stir in the carrots and reseason with salt. Cook for about 2 minutes, and then add canned tomatoes. Use a wooden spoon to break up some of the whole tomatoes and cook over medium heat, stirring from time to time, about 20 minutes. If at any point the veggies or the sauce is getting dry, add some water. Continue cooking another 10 minutes, and then taste for seasoning. The tomatoes should be fairly broken down and the flavors coming together. Cook an additional 10 minutes. The sauce cooks about as long as it takes to make the meatballs from start to finish, about 45 minutes. Stir in the basil leaves and season with Parmesan.