Lottery exists because for some people the thought of being rich is more enticing than the reality of owning an extra buck.
Just because someone realizes that the expected value of their purchase is negative to being almost the same as the cost, doesn't mean that they can't make the purchase.
Whether it makes sense depends on their utility function.