Bring a pot of water to a boil and add the salt and dried oregano to flavor the water.
Finely chop the onion, garlic, and parsley while the water heats.
Heat olive oil in a pan over medium-low heat. Sauté the chopped onions until golden brown, stirring frequently.
Add the minced garlic and cook for 30 seconds until fragrant. Stir in the red chili flakes and cook for another 30 seconds. Set aside 2 teaspoons of this mixture for garnish.
Cook the spaghetti in the boiling water, stirring occasionally. Drain it 1-2 minutes before the package's recommended time.
Combine the drained spaghetti with the sauce in the pan. Add 1/2 cup of pasta cooking water and lemon juice. Stir over medium heat until the sauce thickens and coats the spaghetti.
Serve with the reserved chili onion mixture, fresh parsley, and grated cheese if desired.