01 - Preheat the oven to 375°F. Grease a 9x13-inch baking dish.
02 - Bring a large pot of salted water to a boil. Cook ziti 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 onion and cook until softened, 3 to 4 minutes. Add garlic and cook for 1 additional minute.
04 - Add ground beef to the skillet, breaking it up with a spoon. Cook 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 pepper. Simmer for 5 minutes to meld flavors.
06 - In a bowl, combine ricotta cheese with half of the Parmesan cheese and season with a pinch of salt and pepper.
07 - Spread half of the cooked ziti in the prepared baking dish. Top with half of the meat sauce, dollop half of the ricotta mixture, then sprinkle half of the mozzarella cheese.
08 - Add remaining ziti, meat sauce, ricotta mixture, and finish with the remaining mozzarella and Parmesan cheese.
09 - Cover with foil and bake for 25 minutes.
10 - Remove foil and continue baking for 10 to 15 minutes until cheese is bubbly and golden.
11 - Let the dish rest for 10 minutes before serving. Garnish with fresh basil leaves if desired.