It's not that the money from the lottery ends up in a slush fund, it's that the government cuts funding for education by the amount that it gets from the lottery. The money from the cuts gives the government the same amount of "clean" money to do whatever they want with.
Money is fungible and exactly this trick is common. Best to think of the education funding as a minimum below which funding cannot be cut. In Florida, where I live, it actually funds a specific scholarship program, so it really does have the effect of making the program difficult to slash.