Preheat your oven to 400°F (200°C). On a large baking sheet, toss the eggplant cubes with 4 tablespoons of the olive oil, 1/2 teaspoon of salt, and the red pepper flakes until evenly coated.
Roast the eggplant for 30 to 35 minutes, tossing halfway through. The eggplant is done when it's very soft and nicely browned. Set it aside.
While the eggplant roasts, heat the remaining 1 tablespoon of olive oil in a large skillet or Dutch oven over medium heat. Add the minced garlic and cook for about 1 minute until fragrant, being careful not to let it brown.
Pour the whole peeled tomatoes with their juices into the skillet. Use a spoon to crush the tomatoes into smaller pieces. Stir in the tomato paste, dried oregano, and the remaining 1/2 teaspoon of salt. Bring the sauce to a simmer.
Reduce the heat to low, cover partially, and let the sauce simmer for at least 20 minutes to allow the flavors to meld and the sauce to thicken.
While the sauce simmers, bring a large pot of generously salted water to a boil. Cook the pasta according to package directions until al dente. Before draining, reserve about 1 cup of the starchy pasta water.
Drain the pasta and add it directly to the skillet with the tomato sauce. Add the roasted eggplant and chopped fresh basil. Toss everything together to combine.
Add a splash of the reserved pasta water to the skillet and stir until the sauce coats the pasta nicely. Add more water if the sauce seems too thick.
Serve the pasta in bowls, topped with a generous sprinkle of grated Parmesan or ricotta salata.