Preheat oven to 375°F. Lightly grease a 9x13-inch baking dish.
Bring a large pot of salted water to a boil. Cook rigatoni until very al dente.
Reserve 1/2 cup pasta water, then drain the pasta and set aside.
Warm olive oil in a large skillet over medium heat. Soften the onion until translucent.
Add sausage. Cook, breaking it up, until browned. Drain any excess fat if needed.
Stir in garlic, Italian seasoning, and red pepper flakes. Cook until fragrant, about 30 seconds.
Pour in marinara and tomato paste. Splash in pasta water to loosen. Simmer 5 minutes.
Season sauce with salt and black pepper. Stir in most of the basil, saving some for garnish.
In a bowl, mix ricotta, a few pinches of salt and pepper, and the parsley.
Toss drained rigatoni with most of the sauce. Spread half into the prepared baking dish.
Dot with spoonfuls of ricotta. Sprinkle with half the mozzarella and some Parmesan.
Add remaining pasta and sauce. Top with the rest of the mozzarella and Parmesan.
Bake 20–25 minutes until bubbly and lightly browned. Rest 10 minutes, then garnish with basil.