This seems like a very superficial conclusion, they're very different in practice.
- you can't go broke from spending too much time on facebook/twitter/instagram
- doing something dumb on social media usually doesn't come with the same feeling of regret that's common in people who try to stop gambling but can't
- social media might be addictive but it's a weakly negative, comfy, it-feels-good-when-my-attention-is-here type of addiction, gambling is a whole other beast
- there is very little shame in talking about how much time you spend on social media, hiding gambling losses on the other hand is much more common
Sure, dopamine is probably something they have in common, that's where the similarities end.
Or to build things that use that attention/addiction in less harmful ways. Gambling addiction is only a serious problem if gambling is a process of consistently losing things of value. Casinos (defined broadly) are not an inherent feature of the world; they are an optimization to convert other people's attention and/or addiction into revenue.