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. Set aside.
While pasta is cooking, heat olive oil in a large skillet over medium heat. Add onion and cook for about 5 minutes. Stir red pepper flakes into onion and cook for 2 minutes. Add garlic and cook for 1 more minute.
Add tomatoes, oregano, salt, and pepper to the skillet. Cook for 5-7 minutes, stirring occasionally.
Use a potato masher or the back of a wooden spoon to crush the tomatoes slightly.
Add drained spaghetti to the skillet with the sauce, along with grated parmesan and chopped basil. Toss to coat evenly.
Serve topped with more parmesan, basil, and red pepper flakes.