Many states have laws saying that for every lottery dollar that goes to education, a dollar comes out of the education budget. Usually lottery profits end up in a general fund, the whole education thing is a legislated smoke screen.
The main function of state run lotteries is to take money away from organized criminals and give it to elected criminals instead.