Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally, until tender yet firm to the bite, about 12 minutes.
While spaghetti is cooking, heat olive oil in a skillet over low heat. Add lemon zest and cook for 5 minutes. Strain olive oil through a sieve and return to the skillet. Add shrimp and garlic. Cook in the lemony oil, stirring occasionally, until shrimp turns pink, about 3 minutes. Season with salt and pepper.
Drain spaghetti, reserving about 1/2 cup of the cooking water. Add drained spaghetti, reserved cooking water, and basil to the skillet and mix well. Serve immediately.