01 - Preheat the oven to 375°F. Lightly grease a 9x13-inch baking dish.
02 - Bring a large pot of salted water to a rolling boil. Add ziti pasta and cook according to package directions until al dente. Drain thoroughly and set aside.
03 - While the pasta is cooking, heat the olive oil in a large skillet over medium heat. Add the ground beef and cook, breaking it up with a spoon, until it is thoroughly browned and cooked through.
04 - Add the finely chopped onion to the skillet and cook for 3 to 4 minutes, until softened. Stir in the minced garlic and cook for an additional minute until fragrant.
05 - Pour in the crushed tomatoes, tomato sauce, and tomato paste. Stir in the dried oregano, dried basil, crushed red pepper flakes (if desired), salt, black pepper, and sugar. Bring the sauce to a gentle simmer and cook for 10 to 15 minutes, stirring occasionally, allowing the flavors to meld.
06 - In a medium mixing bowl, combine the ricotta cheese, large egg, and half of the grated Parmesan cheese. Mix until thoroughly combined.
07 - Add the drained cooked ziti pasta directly to the skillet containing the marinara sauce. Toss gently to ensure all the pasta is evenly coated with the sauce.
08 - Spoon half of the sauced ziti pasta into the prepared baking dish. Evenly dollop half of the ricotta cheese mixture over the pasta, then sprinkle with 1 cup of the shredded mozzarella cheese. Repeat this layering process with the remaining sauced pasta, ricotta mixture, and mozzarella cheese. Finally, top the casserole with the remaining grated Parmesan cheese.
09 - Cover the baking dish tightly with aluminum foil and bake for 20 minutes. Remove the foil and continue baking for another 10 to 15 minutes, or until the cheese is melted, bubbly, and golden brown on top.
10 - Allow the baked ziti to rest for 10 minutes before serving. Garnish with fresh chopped parsley or basil, if desired.