Bring a large pot of salted water to a boil. Add the spaghetti and cook until al dente.
Meanwhile, heat the olive oil in a large skillet over medium heat. Add the garlic and red pepper flakes and cook, stirring constantly, until fragrant, about 1 minute.
Add the edamame and cook until warmed through, about 2 minutes more.
Drain the pasta and add it to the skillet with the edamame mixture. Stir in the lemon zest and juice. Sprinkle with Parmesan cheese.