How to Make It
In a large heavy skillet, heat the oil over medium heat until hot. Stir in the garlic, 1/2 teaspoon each salt and pepper, and cook, stirring occasionally, until the garlic is golden, about 2 minutes. Stir in the spinach and pepper flakes and cook, turning with tongs, until the spinach is wilted, about 4 minutes. Remove the skillet from the heat.
In a large pot of boiling salted water, cook the spaghetti until al dente. Reserve 1/2 cup of the pasta cooking water, then drain the pasta. Toss the pasta with the spinach mixture in the skillet along with 1/4 cup of the pasta cooking water. Add more pasta cooking water for a thinner sauce, then season with salt and pepper to taste and serve topped with the walnuts.