Bring a large pot of salted water to a boil. Add the spaghetti and cook according to package instructions until al dente, usually about 8-10 minutes. Reserve about 1 cup of the pasta water before draining the pasta.
While the pasta cooks, heat the olive oil in a large skillet over medium heat.
Add the minced garlic to the skillet and sauté for about 1-2 minutes, or until fragrant, being careful not to burn it.
Add the fresh spinach to the skillet. Cook for 2-3 minutes until the spinach wilts, stirring occasionally.
Once the pasta is cooked, drain it in a colander and add it directly to the skillet with the garlic and spinach. Toss to combine, adding a splash of the reserved pasta water if needed to help coat the pasta.
Stir in the grated Parmesan cheese, salt, black pepper, and red pepper flakes (if using). Combine well until everything is evenly mixed.
Taste and adjust seasoning if necessary. You can add lemon juice at this point for a fresh zing.
Serve immediately, garnishing with additional Parmesan cheese if desired.