Some country decides to make lottery illegal, but the other country is not illegal.
Well for some countries that has a solid foundation from religion like in the middle east which is dominantly comprises of Islamic countries that sees any kind of gambling as a sin it is illegal. Some are illegal due to different state legislation under federal provisions, for example lottery is prohibited in Washington but not on New Jersey.
For Islamic countries, yes, they consider that illegal, and that is prohibited. But for the other country, I don't think that is illegal too. The company that runs the lottery game becomes smart, and they change the prize from money into a product so that it will not look like gambling. But still, that is gambling in the other form.
I have seen some lottery games in here. The lottery has so many prizes, and the price to buy the tickets is not expensive so people can buy as many tickets as they want. The lottery has a number from zero until 10000 (for example), and if someone's number shows up in the winner's list, then he can bring the prize to his home. I think the lottery can be an attractive game and it can attract many people to buy the tickets.
Lotteries are commonly running under the government, this is another way of them to get a support for their platforms and programs for the public. Although the odds of winning is nearly impossible, just think of betting on it is contributing for a good cause and winning is just a bonus. I play lottery every time the jackpot prize is above the usual pool, hoping for my fortune to match it.
When we play the lottery, we expect to win one or two prizes because I am sure that we buy many tickets at a cheap price. We wait for the result, and we want to know if our tickets can be the winner. But the lottery as a game based on luck, it is hard to win if we don't have luck.