Finely chop garlic and spinach. Boil and drain pasta in salted water. Set aside. Heat oil in a pan on medium heat. Add garlic and cook for 2 minutes. Next, add the spinach, cooking for an additional minute. Add spaghetti and all remaining ingredients (salt and red pepper flakes) and cook for one more minute.