Salt the Eggplant: Place the cubed eggplant in a colander and sprinkle with 1 teaspoon of salt. Let it sit for 30 minutes to draw out excess moisture. Rinse the eggplant and pat it thoroughly dry with a clean kitchen towel.
Fry the Eggplant: Heat 3 tablespoons of olive oil in a large skillet over medium heat. Fry the eggplant in batches, turning occasionally, until each piece is golden brown and tender. Transfer the cooked eggplant with a slotted spoon to a paper towel-lined plate and set aside.
Make the Tomato Sauce: Heat the remaining olive oil in the same skillet. Add the sliced garlic and sauté for about 1 minute, until fragrant. Stir in the crushed tomatoes, red pepper flakes, if using, oregano, salt, and black pepper. Simmer the sauce for 15 minutes, stirring occasionally to allow the flavors to develop.
Cook the Pasta: While the sauce simmers, bring a large pot of generously salted water to a boil. Add the pasta and cook according to the package instructions until al dente. Before draining, reserve ½ cup of the pasta water, then drain the pasta.
Combine the Pasta and Sauce: Stir the cooked eggplant into the tomato sauce. Add the drained pasta to the skillet and toss until everything is well coated. If the sauce is too thick, add a splash of the reserved pasta water and toss again until you reach the desired consistency.
Garnish and Serve: Divide the pasta among serving bowls. Top each portion with fresh basil and a generous sprinkle of ricotta salata. If using regular ricotta instead, spoon it over the pasta just before serving.