Warm the olive oil in a large skillet over medium heat. Add the chopped onion and sauté, stirring occasionally, for about 10 minutes until soft and translucent. Stir in the minced garlic and crushed red pepper flakes, cooking for an additional 3 minutes to release their aromas.
Pour in the puréed tomatoes and season with salt, stirring well to incorporate. Allow the sauce to simmer gently, stirring occasionally, until it thickens and deepens in flavor—this should take around 20 minutes. Once the sauce reaches the desired consistency, fold in the freshly chopped basil.
Meanwhile, bring a large pot of salted water to a rolling boil. Cook the spaghetti according to the package instructions until al dente. Before draining, reserve ½ cup of the starchy pasta water.
Return the drained pasta to the pot, then pour in the prepared tomato sauce along with the reserved pasta water. Toss thoroughly to ensure the sauce evenly coats the noodles. Add the butter and grated Parmesan cheese, stirring until both melt seamlessly into the dish.
Serve immediately, garnished with additional fresh basil and extra Parmesan cheese if desired.