
Java
I think the main reason is because the inner class may "outlive" the method in which it was created. If this happens, then the memory storing those variables would be lost and we would run into problems when trying to access them. If the variables are defined as final, then
Java knows that those values will never change and it can move/copy them when the class is created.