In a large pot, heat the olive oil over medium heat. Add the minced garlic and red pepper flakes, sautéing for about 1 minute until fragrant.
Add the spaghetti to the pot, followed by the vegetable broth. Bring to a boil, then reduce the heat to a simmer.
Cook the spaghetti for about 10-12 minutes, stirring occasionally, until the pasta is al dente and most of the broth has been absorbed.
Stir in the cherry tomatoes and spinach, cooking for an additional 2-3 minutes until the spinach wilts and the tomatoes soften.
Remove the pot from heat and stir in the grated Parmesan cheese. Season with salt and pepper to taste.
Serve immediately, garnished with fresh basil leaves if desired.