Heat the oil in a large saucepan over medium heat. Add the onion and garlic and cook, stirring, for 7-10 minutes until the vegetables are soft but not browned. Add the tomatoes, crushing them in your hand to break them up. Add the basil and sugar, if using and season with salt and pepper.
Cook until the sauce is reduced and thickened, about 10 minutes.
Preheat the oven to 425 degrees F.
Cut the eggplants crosswise into 1/2" thick rounds and put them in a large bowl. Add the garlic, salt, and pepper, and drizzle liberally with olive oil. Toss to coat, drizzling in more oil if you needed. Arrange the slices in a single layer on a baking sheet and roast 20 minutes until eggplants are very tender.
While the eggplants are roasting, bring a large pot of salted water to a boil for pasta. About 5 minutes before the eggplants are done, drop the pasta into the boiling water and cook until al dente, 6-8 minutes. Drain. Bring the tomato sauce to a simmer and pour it into a large pasta bowl.
Add the drained spaghetti and stir to coat with the sauce. Fold in the eggplants and the cherry tomatoes. Add the cheese, basil and red pepper flakes and another drizzle of oil, and toss gently.
Serve immediately and pass extra cheese at the table. Enjoy!