Preheat oven to 375°F.
Cook ziti according to package directions. Drain and set aside.
In a large skillet, heat olive oil over medium heat. Add onion and garlic, cook until fragrant.
Add ground beef. Cook until browned. Drain excess fat.
Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer 5 minutes.
In a large bowl, combine cooked pasta, meat sauce, and ricotta cheese. Mix well.
Transfer half the pasta mixture to a greased 9x13 baking dish. Sprinkle with half the mozzarella and parmesan.
Repeat with remaining pasta and cheeses.
Cover with foil and bake for 20 minutes. Uncover and bake another 10 minutes until bubbly and golden on top.
Garnish with fresh basil if using. Serve warm.