Ideal weight is for attaining your ideal weight. If you are underweight then you would gain weight. So it's not possible to suggest you are doing something wrong.

Alex