On one hand, (for the big types of lotteries) the odds are known and they will pretty much always pay if you win, unless you forget that you even bought a ticket or something like that. Both of those are different for most other types of gambling.
On the other hand, most people don't really understand these kinds of odds and lotteries make no effort to educate people on it, even though they're often state-owned. They're pretty much deliberately designed to prey on cognitive biases and lack of education.