I've been thinking about this recently after reading of a drug rehab centre in Scotland advocate this belief. Below is an article from the U.S NIH. If serious drug addiction is a mental illness or illnesses then surely being dangerously addicted to gambling would be another mental illness.
Is drug addiction a mental illness?
Yes, because addiction
changes the brain in fundamental ways, disturbing a person's normal
hierarchy of needs and desires and substituting new priorities connected
with procuring and using the drug. The resulting compulsive behaviors
that override the ability to control impulses despite the consequences
are similar to hallmarks of other mental illnesses.
Addiction changes the brain disturbing the normal hierarchy of needs and desire.
In fact, the DSM, which is the definitive resource of diagnostic criteria for all mental disorders, includes criteria for
drug use disorders, distinguishing between two types: drug abuse and drug dependence.
Drug dependence is synonymous with addiction. By comparison, the criteria for
drug abuse
hinge on the harmful consequences of repeated use but do not include
the compulsive use, tolerance (i.e., needing higher doses to achieve the
same effect), or withdrawal (i.e., symptoms that occur when use is
stopped) that can be signs of addiction.
https://www.drugabuse.gov/publications/research-reports/comorbidity-addiction-other-mental-illnesses/drug-addiction-mental-illness