Cook the ziti pasta according to the package instructions until al dente. Drain and set aside.
In a large skillet over medium heat, heat the olive oil. Add the chopped onion and garlic, sautéing until the onion is translucent, about 3-5 minutes.
Add the ground beef to the skillet, cooking until browned. Drain any excess fat.
Stir in the crushed tomatoes, tomato sauce, oregano, basil, red pepper flakes, salt, and pepper. Simmer for about 10-15 minutes to allow flavors to meld.
While the sauce simmers, mix the ricotta cheese and egg in a bowl until combined. Set aside.
In a large mixing bowl, combine the cooked ziti with the meat sauce, folding until the pasta is evenly coated.
In a 9x13 inch baking dish, layer half of the ziti mixture on the bottom. Spread half of the ricotta mixture over it, then sprinkle with 1 cup of mozzarella cheese.
Top with the remaining ziti mixture, followed by the rest of the ricotta and the remaining 1 cup of mozzarella cheese. Finally, sprinkle the grated Parmesan cheese on top.
Cover with aluminum foil (to prevent sticking, you can spray the foil with cooking spray) and bake in the preheated oven for 25 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the cheese is bubbly and golden brown.
Allow the baked ziti to cool for 5-10 minutes before serving. Garnish with fresh basil if desired.
Notes
Feel free to substitute ground beef with turkey for a lighter option.