Slighlty rinse the capers with water and set aside.
Over medium heat, add the olive oil in a large pan. Add the whole garlic cloves, anchovies and pepper flakes. Mash the anchovies with a fork so that they start dissolving.
Add the capers and let everything cook for about 3 minutes. Remove the garlic once it starts to golden.
Crush the peeled tomatoes and add them to the pan, together with the olives. Stir everything well and let cook for about 10 minutes. Season with salt and pepper to taste.
Meanwhile, in a large pot with salted water cook the spaghetti until al dente, according to the instructions on the package.
Once the pasta is ready, drain it but set aside about half a cup of the pasta water.
Add the pasta to the pan together with some of the pasta water and chopped parsley. Mix well and let it in the pan for a few seconds until you get a nice luscious sauce. Serve immediately.