Bring a large pot of heavily salted water to a boil. Add the pasta and cook until it is not quite al dente, 5 to 8 minutes.
Reserve a cup of cooking water, then drain the pasta.
While the pasta is cooking, warm ¼ cup of oil in a large Dutch oven over medium-high heat.
Add the anchovies and capers. Cook, stirring occasionally, until the capers start to brown, about 3 minutes.
Add the remaining ¼ cup oil, olives, garlic, scallions and red pepper flakes; increase heat to high if using green garlic (leave it at medium high for regular garlic) and cook until garlic is golden, 3 to 5 minutes.
Add the spinach and cook until wilted, 1 to 2 minutes.
Add the pasta and toss for 1 minute. Add a splash of pasta cooking water if the pasta seems dry. Season with salt, if necessary. Toss in the basil leaves.
