Bring a large pot of salted water to a boil. Add the spaghetti and cook according to package instructions until al dente. Reserve about 1 cup of pasta water, then drain the pasta and set it aside.
While the pasta is cooking, heat the olive oil in a large skillet over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant, being careful not to burn it.
Add the chopped spinach to the skillet and stir until wilted, about 3-4 minutes. If using, sprinkle in the red pepper flakes for a hint of spice.
Once the spinach is wilted, add the drained pasta to the skillet. Toss well to combine, adding reserved pasta water a little at a time to create a light sauce, if needed.
Remove the skillet from heat. Stir in the grated Parmesan cheese, and season with salt and pepper to taste.
Serve immediately, garnished with additional Parmesan cheese and lemon wedges, if desired.