Gambling through lotteries is never an investment. It should not be treated as an investment. That would be a wrong approach. An investment will have to have an ROI. Joining lotteries has none.
And lotteries do not only require basic luck. It requires that you are lucky to hit one combination among millions of others.
Yes, you are right. Gambling games are not an investment. We spend money to gamble just expect to win those games, but unfortunately, gambling is based on luck, although some games will give a chance to win if we have knowledge or information. That will be the same as the lottery, which is the gambling game based on luck too.
We know that to hit one combination needs to have a big number of tickets that we should buy, and it is very difficult to combine that number. Playing the lottery cannot be the same as the other gambling games because we depend on one ticket that can come out as the winner.