01 - Bring a large pot of salted water to a boil. Cook penne according to package directions until al dente. Reserve 1/2 cup pasta water before draining.
02 - Heat olive oil in a large skillet over medium heat. Add minced garlic and chopped onion; sauté for 2–3 minutes until softened and fragrant.
03 - Stir in crushed tomatoes, sugar, red pepper flakes (if using), salt, and black pepper. Simmer for 10–12 minutes, stirring occasionally.
04 - Add drained penne to the skillet. Toss thoroughly, adding reserved pasta water as needed for a silky, cohesive sauce.
05 - Gently fold in ricotta cheese, half the basil, and grated Parmesan. Cook for 1–2 minutes until everything is heated through.
06 - Divide among plates. Top with remaining basil and additional Parmesan as desired.