01 - Preheat oven to 375°F. Grease a 9x13-inch baking dish.
02 - Boil salted water in a large pot. Cook ziti until al dente, about 7–8 minutes. Drain and set aside.
03 - Heat olive oil in a large skillet over medium heat. Cook onion until softened, 3–4 minutes. Add garlic and cook an additional 1 minute.
04 - Add ground beef to skillet, breaking it apart. Cook until browned with no pink remaining, about 7 minutes. Drain excess fat if necessary.
05 - Stir in tomato paste, tomato sauce, oregano, basil, crushed red pepper flakes (if using), salt, and black pepper. Simmer for 5 minutes to meld flavors.
06 - In a bowl, mix ricotta cheese with half of the Parmesan cheese and season with salt and pepper.
07 - Spread half of the cooked ziti evenly in the baking dish. Top with half of the meat sauce, then add dollops of half the ricotta mixture. Sprinkle with half of the mozzarella cheese.
08 - Layer remaining ziti, remaining meat sauce, remaining ricotta mixture, and finish with remaining mozzarella and Parmesan cheese.
09 - Cover with foil and bake for 25 minutes.
10 - Remove foil and continue baking for 10–15 minutes until cheese is bubbly and golden brown.
11 - Let the dish rest for 10 minutes before serving. Garnish with fresh basil leaves if desired.