Heat the olive oil in a large saucepan over medium heat. Add the onion and cook for 5 minutes, until softened.
Add the garlic and red pepper flakes and cook for 1 minute.
Stir in the crushed tomatoes, oregano, basil, sugar, and ½ teaspoon salt. Bring to a simmer.
Reduce the heat to low and simmer for 20–25 minutes, stirring occasionally, until slightly thickened. Taste and adjust the seasoning.
Meanwhile, cook the spaghetti in salted boiling water until al dente. Reserve ½ cup pasta water, then drain.
Toss the spaghetti with the sauce, adding pasta water if needed. Serve topped with Parmesan and fresh basil.