While doing cardio intervals at my gym I was amused to see an ad for weight-gain products (probably quackery) on the TV. Amused, because we are so accustomed to seeing ads for weight-loss quackery.
Weight-gain is important for scrawny or physically-undeveloped people who are looking to gain muscle and physical power. The classic 150-lb weakling male who wants to develop might need to gain 10 lbs with a balanced exercise program including weights and a robust diet. Same goes for a weakling stringbean gal.
Whether part of a fitness goal is weight gain or weight loss, a nutritional diary, I believe, is the essential, basic aid. If you record everything you put in your oatmeal-hole, including portion size, while weighing yourself every month, you will get a good idea of how you're moving towards your goals.
For weight gain goals with a 5-6-day per week exercise program including weights, I'd like to see about a 1 lb gain per month for a while. Unless you want to gain fat, a pound/month is plenty. If you can't do that, you need to up your intake. That can be difficult for some people who have to force themselves to eat more than they really want.
For getting rid of excess fat, a reasonable goal is 2 lbs/month with or without exercise. I can't tell you what percentage of American medical problems are related to being overweight, but it could be half of it, from arthritis to breast cancer. Hard exercise doesn't do much for weight loss but it's a good thing for life anyway.
In either case, a detailed diary can help you navigate towards your goal. People are often surprised by how much, or how little, they consume in a day.
This is not a recommendation for an obsessive lifetime plan, just to try for a few months.