This is actually quite common. Sometimes the body increases the metabolism and tries to burn off the extra calories in a process called adaptive thermogenesis. The only way to beat it is to consistently overeat for a few months, until the body eventually adjusts.
There are a few other reasons someone would lose weight while eating a lot: 1. They are actually not eating enough even though they think they are 2. They have some kind of health issues (usually a gastrointestinal issue) that prevents them from absorbing all the nutrients from the food.
If you tell me your age, weight, height and activity level I can let you know how much you should be eating to gain.