Both gambling and doomscrolling can be harmful when done excessively and without balance. The comparison between the two, however, is not so simple: gambling, in some cases, can be seen as a form of entertainment. Doomscrolling, on the other hand, rarely offers this positive side, as feeds are often full of negative news and content.
But doomscrolling can also be used as entertainment and even to learn new things. If you doomscroll and your algo is showing videos about books or general knowledge, you learn something even if small and quickly.
For gambling you just play, you don't learn anything about the content other people create.