Welcome to the MedHelp forum!
Chronic infection can itself hinder weight gain. There are many causes of inability to gain weight like worms in stool, depression, anorexia nervosa, AIDS, cancers especially colon cancers, drug abuse, infections and loss of appetite. Loss of appetite can again be due to certain medications, drug abuse, depression, AIDS, acute and chronic infections, cancers and hypothyroidism. Either you do not eat well or there is increased metabolism as in hyperthyroid states, HIV, cancer etc. Poor absorption as in irritable bowel syndromes and malabsorption syndromes too is possible. Malabsorption syndromes are seen in intestinal tuberculosis, HIV, tropical sprue, parasites in stool and Whipple’s Disease. Diabetes too can be the cause.
The best thing would be to consult a general practitioner or PCP and try and assess what is the cause of your problem. Then proper referral for concerned specialist can take things further and get you proper treatment. Take care!
Might be a good idea to get your Thyroid checked and consider the possibility of a tonsillectomy.