The rule for gaining weight is to eat more calories than you burn. If you are doing cardio while trying to gain weight, you’ll be burning a lot more calories. This is fine if you up your calorie intake, but doing extra exercising also raises your metabolism well after you leave the gym. You’ll have to adjust your calorie intake for that too.
Cardio also causes muscle soreness which might slow down your resistance training and cause you not to gain as much muscle as you wanted.
While it seems as though there are a lot of negatives, there are also a lot of good reasons to do cardio. Cardio increases your body’s ability to deliver oxygen to your muscles, improves cardiovascular health and with certain modes of cardio (those which involve body weight: running) can also increase bone density.
Cardio will slow down your weight gain so limiting it might be a good idea. Eliminating it completely from your routine should be avoided since eventually you’ll have to start doing cardio again and when you do, it’ll be a lot easier if you never stopped.