Because you get it back. If anything, the state run deposit programs lose money from people returning cans from out of the state.
But it doesn't even have to be state run. It could simply be mandated that the manufacturers buy back their old batteries for a minimum price.