Bring a large pot of salted water to a boil. Add the pasta and cook according to package instructions until al dente. Reserve 1 cup of pasta water, and then drain the pasta.
While the pasta is cooking, heat the olive oil in a large skillet over medium heat. Add the minced garlic and red pepper flakes (if using). Sauté for about 1 minute, until fragrant, being careful not to burn the garlic.
Add the chopped spinach to the skillet and cook for 2-3 minutes, stirring frequently, until wilted.
Pour in the vegetable broth and season with salt and pepper. Let it simmer for 2-3 minutes.
Add the drained pasta to the skillet and toss everything together. If the pasta seems dry, add some reserved pasta water a little at a time until you reach the desired consistency.
Stir in the grated Parmesan cheese and chopped basil (if using). Mix well until the cheese is melted and everything is combined.
Taste and adjust seasoning if necessary. Serve hot, garnished with additional cheese and basil if desired.