Generally, no it is not a smart investement, since you lose far more often than you win. Donating money directly to help education (or in my state reduce property taxes) is more efficient, but it doesn't offer the person (who would otherwise buy a lottery ticket), any chance at all of getting a return except for a 'feel good' feeling.
And who is going to bother mailing $1 every week to their preferred cause (which will also cost them $0.41 for the stamp). Then it certainly isn't more effecient unless you saved up that money for a month or year and sent it all at one time.
As long as it's reasonable, I don't see what's wrong with playing the lottery. No, people should not be playing it with the attitude that 'This is the only way I can get any money over $1,000 (odds are they will save up that much without playing before they actually get that money by winning) , but should be playing it for mere entertainment.
If having the choice of spending $1 on a lottery ticket vs. buying a bag of chips or a candy bar, I'll take the lottery ticket.
The scratch-off tickets offer more entertainment value than the once or twice a week drawings (like powerball), but the scratch-offs can be more addictive and cause people to overspend, or right away re-spend what they just won "I know that next ticket is a winner!" I play the powerball. Buy a few tickets and then have to wait a few days before I buy some more for the next drawing.
When I worked at a gas station a decade ago, I ended up selling $120 worth of scratch-off tickets to one lady one day. I think she spent maybe $50 of her own money, with the rest being bought from the $1-$20 'winners' she scratched off.