Bring a large pot of salted water to a boil. Once boiling, add the whole wheat spaghetti and cook according to the package instructions until al dente, usually about 9-11 minutes. Reserve 1 cup of the pasta cooking water, then drain the pasta in a colander and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant.
Add the halved cherry tomatoes to the skillet and cook for 3-4 minutes, until they start to soften.
Stir in the chopped spinach, salt, black pepper, and red pepper flakes (if using). Cook for another 2-3 minutes until the spinach wilts.
Add the cooked spaghetti to the skillet, tossing everything together. If the mixture seems dry, add some of the reserved pasta cooking water a little at a time until you reach your desired consistency.
Serve immediately, topped with grated Parmesan cheese if desired.
For an extra boost of protein, consider adding grilled chicken or chickpeas to the dish.
You can also swap out the spinach for other leafy greens like kale or arugula according to your preference.
This dish is best enjoyed fresh but can be stored in the refrigerator for up to 3 days. Reheat gently on the stove or in the microwave.