In a large saucepan, heat the oil. Add in the garlic and cook until brown and fragrant. Add in the vinegar, tomatoes and spinach until the spinach has wilted. Toss in the spaghetti and the Parmesan, and mix until fully combined. Add in the chili flakes if using.