Bring a large pot of salted water to a rolling boil and cook the spaghetti until just al dente, about 8 minutes. Reserve a cup of starchy pasta water, then drain and set aside.
While the pasta cooks, heat the olive oil in a large skillet over medium heat until shimmering and fragrant. Add the sliced leeks and a pinch of salt, cooking gently for about 8-10 minutes until they soften and turn a light golden brown, filling the kitchen with a sweet, earthy aroma.
Add the minced garlic to the skillet with the leeks and cook for another 1-2 minutes, stirring constantly until the garlic is golden and fragrant, avoiding any browning that can make it bitter.
Gradually add the chopped spinach in batches, stirring until each addition wilts down and turns a vibrant green, about 2-3 minutes. If the mixture releases excess water, cook a little longer until it evaporates, leaving the greens tender and slightly smoky.
Combine the drained pasta directly into the skillet with the leeks and spinach. Toss to coat the strands evenly, adding a splash of the reserved pasta water to create a silky, cohesive sauce that clings to every piece of spaghetti.
Squeeze fresh lemon juice over the pasta and toss again to brighten the flavors. Taste and adjust with salt and pepper as needed for seasoning.
Remove from heat, plate the pasta, and serve immediately, garnished with a drizzle of olive oil or a sprinkle of grated cheese if desired, while still steaming and fragrant.