Cook the spaghetti or linguine according to package instructions until al dente. Drain and set aside, reserving 1/2 cup of pasta water.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant, being careful not to burn it.
Add the shrimp to the skillet and cook for 2-3 minutes, or until they turn pink and opaque. Remove the shrimp from the skillet and set aside.
In the same skillet, add the diced tomatoes (with their juices), Italian seasoning, salt, pepper, and red pepper flakes. Simmer for about 5 minutes to allow the flavors to meld.
Stir in the fresh spinach and cook until wilted, about 2 minutes. Return the shrimp to the skillet and mix well.
Add the cooked pasta to the skillet, tossing everything together. If the mixture seems dry, add a bit of the reserved pasta water until you reach your desired consistency.
Serve immediately, topped with grated Parmesan cheese and fresh basil if desired.