A lottery is a tax on irrational hope. The more irrational hope you have the higher the tax. (Not that this is a reason not to adopt one, just examing the issue with eyes open)
South Carolina, which is temperamentally similar to Alabama, got over the sin tax by "earmarking the proceeds for education."
Once adopted, the legislature simply reduced the education appropriations by the same amount that the lottery pumped into education. So, yes, the lottery proceeds went to pay for education, but the net effect was no change in education spending in the Palmetto State.