Australian state governments have spent years making up funding shortfalls by bringing in billions in gambling revenue.