For the Roasted Eggplant: Pre-heat the oven to 400 degrees. Line two baking sheets with parchment paper and set aside.
Divide the eggplant cubes among the baking sheets. Drizzle them with olive oil and sprinkle them with salt, black pepper, and red pepper flakes (if using). Toss them well to ensure that they are distributed evenly and in a single layer.
Roast in the oven for 30-35 minutes, turning the eggplant halfway through for even roasting. Set aside to cool. Do not turn the oven off.
Meanwhile, cook the pasta. Ten to fifteen minutes before the eggplant is ready, bring a large pot of water to a boil. Season the pasta water generously with salt. Add the pasta and cook until it is al dente. Timing might differ depending on the brand you use, so be sure to check the instructions on the packaging. Mine took about 9-10 minutes.
Reserve 1 cup of the pasta water. Then drain the pasta, and place it in a large bowl. Pour the tomato sauce into the bowl and toss to combine, ensuring that the pasta is fully coated with the sauce. If the pasta sticks, feel free to use some of the reserved pasta water to keep it moist.
In a separate small bowl, mix together the ricotta and chopped basil. Season with kosher salt and black pepper.
To assemble, spray a large oven-proof casserole dish (9X13 is ideal) with vegetable spray and oil on the sides of the dish.
Place half of the ziti and tomato sauce mixture at the bottom of the casserole dish. Spread half of the baked eggplant cubes evenly on top.
Add half of the ricotta-basil mixture on top in dollops.
Sprinkle the whole thing with half of the shredded mozzarella.
Repeat the same steps for the second layer, starting with the rest of the ziti, eggplant cubes, and ricotta. Finish it off with an even sprinkling of the remaining mozzarella cheese.
Bake for 30-35 minutes or until it is bubbly and the cheese on top is lightly browned.
When ready to serve, sprinkle it with fresh basil leaves. Serve while still warm.