Bring a large pot of salted water to a boil. Cook spaghetti according to package instructions until al dente. Reserve ½ cup of pasta water before draining.
In a large pan, heat olive oil and add anchovy fillets. Cook over medium heat until the anchovies dissolve into the oil.
Add garlic and chili, sauté for 1 minute until fragrant.
Stir in canned tomatoes and cook for 10 minutes, breaking them down with a spoon.
Add olives and capers, season with pepper, and simmer for 5 more minutes.
Toss the drained spaghetti into the sauce, adding a little reserved pasta water if needed for consistency.
Garnish with fresh parsley and serve immediately.