Bring a large pot of salted water to a boil. Add the spaghetti and cook as the label directs. Reserve 2/3 cup cooking water, then drain.
Meanwhile, heat the olive oil in a large skillet over high heat. Add the shallot and cook, stirring occasionally, until slightly softened, about 2 minutes. Add the beans, cherry peppers, garlic, red pepper flakes and ½ teaspoon salt; cook, stirring occasionally, until the garlic starts browning, 2 to 3 minutes. Add the shrimp and cook, stirring occasionally, until opaque, about 3 minutes. Add the wine and cook until slightly reduced, about 2 minutes.
Add the pasta and lemon zest and juice to the skillet and toss to coat. Gradually add the reserved cooking water as needed to loosen. Add the parsley, season with salt and pepper and toss.