Bring a large pot of salted water to a boil and cook the campanelle pasta until just al dente (usually 1-2 minutes under the package directions), then drain and set aside. While the pasta cooks, preheat your oven to 350°F and lightly spray a 9x13 inch baking dish with cooking spray. I like to undercook the pasta slightly since it will continue cooking in the oven—this prevents it from becoming mushy.
Heat a large skillet over medium-high heat and add the ground beef, diced onion, and 1.5 teaspoons minced garlic. Cook, breaking up the meat with a spoon, until the beef is no longer pink and the onion is softened (about 5-7 minutes). Drain off any excess fat, then stir in the Italian seasoning, 3/4 teaspoon salt, and 1/2 teaspoon black pepper. Let cook for 1-2 minutes to bloom the spices, then pour in the marinara sauce and 1/4 cup water. Simmer gently for 2-3 minutes, then add the cooked pasta from Step 1 and the red pepper flakes, stirring to combine. Remove from heat and set aside.
In a separate bowl, combine the ricotta cheese, egg, 1.75 cups shredded mozzarella, 1/3 cup grated Parmesan, 1/2 teaspoon minced garlic, dried parsley, and 1/4 teaspoon black pepper. Stir until well blended and creamy. This mixture will create the rich, cheesy middle layer of your casserole.
Spread half of the beef and pasta mixture from Step 2 evenly across the bottom of your prepared baking dish. Spoon the ricotta cheese mixture from Step 3 over the meat layer, spreading it gently to cover. Top with the remaining beef and pasta mixture from Step 2, spreading it evenly across the top. The filling should be completely covered by the meat sauce.
Cover the baking dish tightly with foil and bake for 30 minutes. Remove the foil, then sprinkle the remaining 1.5 cups shredded mozzarella and 1/4 cup grated Parmesan evenly over the top. Return to the oven and bake uncovered for 5-10 minutes until the cheese is melted and bubbly. The top should be lightly golden and the edges should bubble slightly—this is how you know it's done.
Remove the casserole from the oven and let it rest for 5 minutes before serving. This resting time allows the layers to set slightly so they won't fall apart when you scoop. Top with fresh basil and serve.