I think the people buying scratch offs every week are gambling. The people who buy a Powerball or Mega Millions a few times a year, when it gets huge, are just doing it just for entertainment’s sake and have no serious expectation of winning.
It’s still problematic, but the real argument for keeping the lottery is that without it, organized crime would start running more of their own numbers games again.