In a large pot, bring 6 quarts water to a boil over high heat. Season with 1/2 cup salt. The pasta water should taste like seawater.
Meanwhile, make the sauce: In a medium skillet, heat the olive oil over medium heat. Add the onion and season with salt. Cook until the onion becomes translucent, 5 to 8 minutes, adding water if the pan gets too dry. Add the garlic and red pepper flakes and cook until the garlic softens, about 1 minute. Add the carrots, sugar and the tomatoes with their juices. Use a wooden spoon to break up some of the tomatoes and season with salt. Cook, stirring from time to time, until the tomatoes are tender when pierced with the tip of a knife, 8 to 10 minutes. Add 1/2 cup water and continue cooking until the tomatoes fall apart, another 8 to 10 minutes. Taste for seasoning and add pasta water, if necessary.
Cook the pasta: Add the pasta to the pot of boiling water and stir so it doesn't stick to the bottom as it cooks. Cook the pasta until it is al dente (chewy but not hard or raw tasting), 10 to 12 minutes. Drain the pasta in a colander, reserving some of the pasta water in case you need it to adjust the sauce.
Assemble the dish: In a large bowl, toss the pasta with half of the Parmigiano-Reggiano. (Tossing the pasta directly with the cheese before adding the sauce gives the pasta a richness and saltiness.) Stir the sauce into the pasta. Taste for seasoning. Add a little of the reserved pasta water if needed to create a sauce that lightly coats the pasta. Tear half of the basil leaves and stir to combine. Serve immediately with the remaining Parmigiano-Reggiano and basil leaves.