$\begingroup$

If you use a plate glass window instead of a wall you'll find that the rubber and iron balls bounce by a similar amount (though be careful throwing iron balls at windows :-).

It's a basic principle in physics that energy cannot be lost. The rubber ball starts off with kinetic energy, hits the wall, and rebounds moving with about the same kinetic energy. So no energy is lost. If the iron ball doesn't bounce it must mean that the energy it originally had has been transferred to the wall.

Rubber balls are soft, so they decelerate relatively slowly and they deform and spread out as they hit the wall. This means that the pressure they exert on the wall while they are bouncing is relatively low. By contrast an iron ball is very hard so it stops very suddenly and all the force it exerts on the wall is concentrated on a small area. That means the pressure is high enough to damage the wall. It might cause a visible dent, or it might just cause cracks within the wall that you can't see. In both cases energy is used in damaging the wall, and this energy comes from the motion of the ball. That means little energy is left for the iron ball to bounce back.

I started by saying the iron ball would bounce off plate glass. This is because plate glass is very rigid and provided you don't shatter it the glass is not damaged by the iron ball. Since no energy is absorbed by the glass, the iron ball bounces back just as the rubber ball does.