Heat a medium saucepan over medium heat. Add the 1/4 cup olive oil and heat until hot. Add the onions, garlic and a large pinch of salt. Cook, stirring occasionally, until the vegetables soften, 3 to 5 minutes.
Stir in the red pepper flakes and tomatoes and season with salt and black pepper. Tie the oregano and thyme together with a piece of butcher's twine, then add to the sauce. Bring to a simmer.
Meanwhile, bring a large pot of salted water to a boil. Cook the spaghetti 2 minutes less than the time indicated in the package directions. Remove the herb bundle from the sauce and discard.
Add the spaghetti to the warm sauce along with 1/4 cup of the pasta water. Let the spaghetti finish cooking in the sauce, stirring occasionally, 2 to 3 minutes.
Remove from the heat and stir in the butter, basil leaves and a good drizzle of extra-virgin olive oil. Serve with freshly grated Parmesan over the top.