01 - Preheat oven to 375°F. Grease a 9x13-inch baking dish.
02 - Bring a large pot of salted water to a boil. Cook ziti until al dente according to package instructions. Drain and set aside.
03 - In a large skillet over medium heat, heat olive oil. Add ground beef and cook, breaking up with a spoon, until browned and cooked through.
04 - Add chopped onion to the skillet and cook 3 to 4 minutes until softened. Stir in garlic and cook an additional minute.
05 - Add crushed tomatoes, tomato sauce, and tomato paste. Stir in oregano, basil, crushed red pepper flakes (if using), salt, black pepper, and sugar. Simmer for 10 to 15 minutes, stirring occasionally.
06 - In a medium bowl, combine ricotta cheese, egg, and half of the grated parmesan cheese until blended.
07 - Add cooked ziti to the skillet with meat sauce and toss to coat thoroughly.
08 - Spread half of the sauced pasta into the prepared baking dish. Dollop half of the ricotta mixture over the pasta and sprinkle with 1 cup mozzarella cheese. Repeat layers with remaining pasta, ricotta mixture, and mozzarella. Top with remaining parmesan cheese.
09 - Cover the dish with foil and bake 20 minutes. Remove foil and continue baking 10 to 15 minutes until cheese is melted and golden.
10 - Allow to cool 10 minutes before serving. Garnish with fresh parsley or basil if desired.