The concept also applies to non-profit donations more broadly, but only under the assumption that the size of the donation is small enough that it doesn't exceed the total amount that the non-profit would have spent on that cause anyway.
If you're donating a large amount that exceeds the current budget for your chosen cause, then your donation does make a difference -- but it's not quite as large as it seems. It might only be the difference between the previous spending level and the new level (after your donation and after some budget refactoring).
To use your example, if the state was spending $1B on on schools previously, then donating less than $1B doesn't necessarily make a difference to school funding -- they can just push money around. But if you donate $1.2B, then you have made a difference -- of $0.2B.
If you're donating to a small non-profit, though, then maybe it's easier to find targets in which you could dwarf the existing spending on your topic of choice. (Not to say that you should, though. I agree with Graham's argument.)
which sucks - but it points to a problem of under-specifying the "rules".
The original intend is to ensure that the proceeds of the lottery added to the education fund. But the wording of the rule only specified where the lottery money got spent, rather than specifying the desired outcome (that schools got $X more funding).
That effectively makes it a tax on the innumerate.
People are going to gamble though, so the state might as well take a cut as a way to discourage it.
It's fairly well established that rather than discouraging gambling, the result of government endorsement and taxation is a net increase in gambling.
I think I've also seen some analysis that after about a decade, the increase in gambling behavior is also correlated with less taxable income from citizens, higher consumption of alcohol, etc., which amplifies the regressive effects.