Preheat oven to 375°F (190°C). Grease a 9x13-inch baking dish.
Cook pasta in salted water until al dente. Drain and set aside.
In a large skillet, heat olive oil over medium heat. Add onion and cook until softened, about 5 minutes. Stir in garlic and cook for 1 minute.
Stir in pumpkin puree, tomato sauce, heavy cream, Italian seasoning, smoked paprika, salt, pepper, and red pepper flakes (if using). Simmer for 5–7 minutes until slightly thickened.
Add cooked pasta to the sauce and toss until well coated.
Transfer mixture to the prepared baking dish. Sprinkle with mozzarella and Parmesan cheeses.
Bake uncovered for 20–25 minutes, until cheese is melted and bubbly.
Garnish with fresh basil or parsley before serving.