Say $2MM in tickets are sold, putting $1MM in the pot. And no-one wins. So next week, $2MM in tickets are sold, putting $1MM in the pot - which already contained $1MM from last week. Continue this over a few weeks.
After 5 weeks you have $5MM in the pot - and another $5MM in profits. On week 5, $2MM in tickets could buy $5MM in winnings, but that doesn't mean the scheme is negative. It just means this week's draw looks like a good deal.
States love lotteries because the house cannot lose - their share is taken before it goes in the pot, so the pot is never a liability.