That's kinda the point of the lawsuit: they can't. Redbox is buying Disney movies at retail. The only way for Disney to stop Redbox from doing what they're doing is to stop selling physical copies of movies.
They can stop selling the retail copies with the code included. That would pinch off Redbox, but upset customers.
They could stop offering download codes and instead allow people to register their retail copy to the streaming service with a copy of their receipt. Again, not very consumer friendly, but Disney is big enough to possibly get away with it.