Preheat the oven to 375°F (190°C).
Bring a large pot of salted water to a boil and cook the ziti until al dente, about 2 minutes less than the package directions. Drain well.
Heat the olive oil in a large skillet over medium heat.
Add the sausage or ground beef and cook for 6–8 minutes, breaking it into crumbles.
Stir in the onion and cook for 3–4 minutes until softened.
Add the garlic and cook for 30 seconds until fragrant.
Stir in the marinara sauce, crushed tomatoes, Italian seasoning, basil, salt, black pepper, and red pepper flakes. Simmer for 10 minutes.
In a large mixing bowl, combine the ricotta, egg, parsley, 1 cup mozzarella, and ½ cup Parmesan.
Fold the cooked ziti into the meat sauce until evenly coated.
Spread half of the pasta mixture into the baking dish.
Spoon the ricotta mixture evenly over the pasta.
Top with the remaining pasta mixture.
Sprinkle with the remaining 1 cup mozzarella and ¼ cup Parmesan.
Cover loosely with foil and bake for 25 minutes.
Remove the foil and bake for another 15 minutes, until the cheese is melted and golden brown.
Remove from the oven and let the baked ziti rest for 10 minutes before serving. This helps the layers set and makes serving easier.
Garnish with fresh parsley and extra Parmesan if desired.