Adjust oven rack to middle position and preheat oven to 400℉.
Mix ricotta, 2 tablespoons oil, ½ teaspoon salt, and ½ teaspoon pepper in a bowl.
In a separate bowl, mix together mozzarella and Parmesan.
Meanwhile, bring 6 quarts of water to boil in Dutch oven. Add 1 ½ tablespoons salt and pasta and cook until al dente. Reserve 1 ½ cups pasta cooking water, drain pasta, and set aside.
Dry emptied pot, add remaining 2 tablespoons oil, garlic, and pepper flakes, and cook over medium heat for 1 to 2 minutes until fragrant. Stir in tomatoes and simmer for 15 minutes.
Take off heat and season with salt and pepper to taste. Stir in cooked pasta and reserved cooking water.
Pour half of pasta-sauce mixture into 9-inch by 13-inch dish. Dollop large spoonfuls of ricotta mixture over pasta. Pour remaining sauce mixture over top and sprinkle mozzarella mixture on top.
Bake for 25 to 35 minutes until filling is bubbling and cheese has started to brown.
Let the casserole cool for 10 minutes. Sprinkle with basil and serve.