As Adie states, many people dependent on illicit opioid drugs are underweight- this is a result of poverty and malnutrition rather than a pharmacological effect of the drug. If you are spending all your money on the drug, you have less to spend on food (or accommodation, health care etc). Opioids supress the appetite. (When someone has been using opiates for a long time, they can end up "confusing" (or "associating") hunger pains with the need to take more opiates).
In people prescribed opioids (as treatment for pain or for drug dependence), or when people who are wealthy or have access to opioids professionally use them illicitly, these economic factors are not so important but the effect on sugar preference etc that Adie mentions become significant.
Below is the article Adie referred to.
Note that many people on methadone maintenance drink alcohol regularly.
Dental problems in this population may also be related to tobacco smoking, and to xerostomia caused by smoking and by methadone.
Yim suggests a U shaped curve- where low endogenous opioids lead to anorexia, but where very high levels suppress appetite and can also lead to anorexia.
Opioids, feeding, and anorexias
Yim et al 1984
http://www.ncbi.nlm.nih.gov/pubmed/6149154
.
Opioid regulation of food intake and body weight in humans.