Red wine seems to be the pasta wine. You can drink any kind of wine you choose with your spaghetti though. I have always thought this was more of a personal taste than just what someone says is acceptable.
Red wines such as barbera, dolcetto, and valpolicella have tangy acidity and bright fruit, making them harmonious companions to tomato-based pasta dishes. Avoid heavy, tannic reds, as these tend to clash with tomatoes.