Set your oven to 400°F and line a medium sheet pan with parchment paper so the tomatoes roast evenly and release their juices without sticking.
Toss halved cherry tomatoes with 4 tablespoons pesto on the prepared pan, season with salt and pepper, and spread them in a single layer to help them roast evenly.
Place the pan in the oven and roast for 15 to 20 minutes until the tomatoes are soft and juicy; let them cool slightly so they blend more smoothly.
Boil the spaghetti in salted water until al dente, then reserve 1 cup of the cooking water before draining the pasta and setting it aside.
Transfer the roasted tomatoes into a blender along with the remaining 2 tablespoons pesto, minced garlic, granulated sugar, and ½ cup of the reserved pasta water; blend on high until smooth.
Pour the tomato sauce into a large skillet, add the hot spaghetti, ½ cup pasta water, Parmesan cheese, and basil; warm over medium heat for 3 to 5 minutes until the sauce clings to the noodles, adding more water if needed.
Taste the pasta and adjust salt and pepper, then serve it warm with extra Parmesan and basil on top for added flavor.