Cook pasta. Cook the ziti according to the package directions, but reduce the cooking time by 2 minutes. It will continue cooking in the oven, so slightly undercooking it now helps keep the pasta perfectly tender. Drain well.
Cook chicken. Heat the olive oil in a large skillet over medium-high heat. Add the ground chicken, onion, and garlic, and cook, breaking up the chicken with a spatula, until it's no longer pink and the onions have softened, about 5 minutes.
Cook sauce. Stir in the marinara sauce, salt, Italian seasoning, red pepper flakes, black pepper, and sugar. Reduce the heat to medium and let the sauce simmer for 4 to 5 minutes, stirring occasionally, until it thickens slightly.
Finish sauce. Remove the pan from the heat and stir in the cooked pasta until it's evenly coated with the sauce. Add the ricotta and basil, then gently fold everything together just 2 to 3 times. Don't fully mix in the ricotta—you want little pockets of creamy cheese throughout the baked ziti.
Assemble. Preheat the oven to 350°F. Spread half of the pasta mixture into a 9x13-inch baking dish, then sprinkle with half of the mozzarella and Parmesan. Top with the remaining pasta, followed by the rest of the mozzarella and Parmesan, making sure the cheese is evenly distributed over the top.
Bake. Loosely cover the baking dish with foil and bake for 20 minutes. Remove the foil and continue baking for 10 to 15 minutes, or until the cheese is melted, bubbly, and lightly golden. Sprinkle with fresh basil just before serving and enjoy while it's hot!