Gambling is not an obsessive compulsive disorder (OCD), as OCD is a type of anxiety disorder. Gambling is not an anxiety disorder- rather, it is an addiction. Specifically, gambling addiction is a behavioral addiction.
Gambling may seem to share the same qualities of OCD, as a person with OCD engages in compulsive behaviors, which are repeated over and over again. In gambling addiction, the person repeats the gambling behavior over and over until it impacts their life.
The difference is that the compulsions in OCD are done repeatedly to decrease the anxiety associated with the obsessive thoughts that they are harboring. In gambling, the gambling behaviors are repeated due to their addiction to the euphoria of the gambling. So in OCD, the compulsions are done to decrease anxiety, while in gambling the behaviors are due to their addiction to the euphoria produced by the behavior.