I don't know what conditions are associated with weight gain, but my wife has mentioned repeatedly that unexplained weight loss is a red flag for cancer. (Cancer cells have, of course, a very high metabolism.)

Cheers,
Ben