Cook the spaghetti according to package instructions in a large pot of salted boiling water until al dente. Drain and set aside, reserving 1/2 cup of the pasta water.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and red pepper flakes, sautéing for about 1 minute until fragrant.
Stir in the diced tomatoes, black olives, capers, oregano, salt, and black pepper. Bring the mixture to a simmer and cook for about 10 minutes, allowing the flavors to meld.
Add the cooked spaghetti to the skillet, tossing to combine. If the sauce is too thick, gradually add reserved pasta water until desired consistency is reached.
Serve immediately, garnished with fresh parsley and grated Parmesan cheese if desired.