Bring a large pot of salted water to a boil and add spaghetti. Cook according to package directions until al dente. Drain, reserving about ½ cup of the water. You might need it to thin out the pasta sauce a bit. Set cooked pasta and reserved water aside.
While pasta is cooking, heat olive oil in a large skillet over medium heat. Add onion and cook for about 5 minutes, until onion is starting to soften. Stir red pepper flakes into onion and cook for 2 minutes. Add garlic and cook for 1 more minute, until fragrant.
Add tomatoes, oregano, salt, and pepper to the skillet. Cook for 5-7 minutes, stirring occasionally, until tomatoes have softened and released their juices.
Use a potato masher or the back of a wooden spoon to crush the tomatoes slightly and release more of their juices.
Add drained spaghetti to the skillet with the sauce, along with grated parmesan and chopped basil and toss to coat evenly. If sauce looks dry, add some of the reserved pasta water a little at a time.
Serve topped with more parmesan, basil, and red pepper flakes.