01 - Preheat oven to 375°F. Grease a 9x13-inch baking dish.
02 - Bring a large pot of salted water to a boil. Add ziti and cook until just al dente, about 7 to 8 minutes. Drain and set aside.
03 - Heat olive oil in a large skillet over medium heat. Add chopped onion and cook until softened, approximately 3 to 4 minutes. Add minced garlic and cook an additional minute.
04 - Add ground beef to skillet. Cook, breaking apart with a spoon, until browned and no longer pink, about 7 minutes. Drain excess fat if necessary.
05 - Stir in tomato paste, tomato pasta sauce, oregano, basil, crushed red pepper flakes if using, salt, and black pepper. Simmer gently for 5 minutes to blend flavors.
06 - In a separate bowl, combine ricotta cheese with half of the grated Parmesan cheese. Season lightly with salt and pepper.
07 - Spread half of the cooked ziti evenly in the baking dish. Layer half the meat sauce on top, followed by half the ricotta mixture in dollops, then sprinkle with half the shredded mozzarella.
08 - Repeat layers with remaining ziti, meat sauce, ricotta mixture, and top with remaining mozzarella and Parmesan cheese.
09 - Cover the dish with foil and bake in preheated oven for 25 minutes.
10 - Remove foil and bake an additional 10 to 15 minutes until cheese is bubbly and golden brown.
11 - Allow to rest for 10 minutes before serving. Garnish with fresh basil leaves if desired.