Pasta is high in carbohydrates, a nutrient that the body uses for energy. When you consume large amounts of carbohydrates, your body stores what it cannot readily use for energy as fat. You gain weight when you burn fewer calories than you consume. This statement is true, however, for any food---not just pasta.
The downside to pasta is that we often eat too much of the wrong kind. Many of us eat highly refined pastas made of white flour and semolina. These types of pastas don't provide the added benefits of fiber and other nutrients found in whole-grain pastas.
If you eat pasta made of refined flours, be sure to balance your pasta meals with fiber. This means eating plenty of whole grains,vegetables, and legumes.