Cook spaghetti according to package directions until al dente. Drain and set aside.
While the spaghetti is cooking, heat olive oil in a large skillet over medium heat. Add minced garlic and cook until fragrant, about 30 seconds.
Add cherry tomatoes to the skillet and cook until they begin to soften, about 3-4 minutes.
Add shrimp to the skillet and cook until pink and opaque, about 3-4 minutes per side.
Add baby spinach to the skillet and cook until wilted, about 1-2 minutes.
Add cooked spaghetti to the skillet and toss everything together until well combined.
Season with salt and pepper, and red pepper flakes (optional) to taste.
Serve hot, garnished with grated Parmesan cheese (optional).