User Charu _Bamble has already introduced the notion of splitting the velocities of the ball into $X$ and $Y$ component vectors, with $X$ being parallel to the wall, and $Y$ being perpendicular.
Let's view the edge cases:
- For Y=0, the ball is just moving parallel to the wall. Assume that it is going as close to the wall as you can imagine, i.e. barely not touching at all. Hence, the ball and the wall do not interact at all. Very important: the concept of "touching", on atomar levels, is very complicated. Atoms are not balls; and no atoms ever touch in real life situations anyways - they get repelled by the fundamental forces, mostly the electromagnetic force, long before the actual particles get anywhere near each other, on atomic scales. While of course atoms passing each other by would influence each other, the aspect of them being in the macro iron ball lattice is much much more relevant; so some very small forces ocuring here while the ideally smooth ball flys along the ideally smooth wall are neglectable.
- For X=0, the ball goes straight into the wall and bounces back, but this is also uninteresting because this special case indeed is the what if case of your question (i.e., the ball goes back exactly on its original, reversed path). What happens atomically in this case is that the atoms of the ball get ever closer to the atoms of the wall; and at some point (long before the actual atoms would "overlap") are repelled by electromagnetic forces. This in turn can deform both participants depending on their elasticity, but in our particular case, both the ball and the wall are rather rigid, and presumably the ball is slow enough not to punch a hole into the wall. This means that all those forces occuring at the very border between the wall and the ball just reflect the ball right back where it came from.
Now with that mental model, let's handle the case where there is both an X and Y component; let's just say it hits the wall at 45° (X=Y).
Individual iron atoms will indeed maybe get close to individual wall atoms, and those individual interactions, if they were heads-on (from the point of view of the atoms) will of course in a way lead to a force pushing straight back. So a "straight-back" force will work on that one iron atom (and the opposite force on the "wall atom"). Both of these atoms are firmly held by their neighbours; the wall atom cannot go anywhere, so stays there more or less; the iron atom will impart a tiny little force on its neighbours, and will want to travel back right where it came from.
But the issue is that we cannot really only watch individual atoms here; neither the ball nor the wall are gasses, but are already packed relatively densely. That means the previous case can - statistically - almost never happen. Even if there is an "outlier" atom in the wall which gets very close to the wall before all of its neighbours, all the electromagnetic influences of the wall atoms closest to it will themselves form a field which is almost like a plane or a wall itself. It will not, on average, receive just the spherical nature of a single wall atom, but will interact with all the little spheres of all the little wall atoms, statistically smeared into a big boiling mass of electromagnetism.
While the X motion along those "wall of electromagnetism" will have some effect, this will be extremely less than the effect of the Y motion which would make the iron atom move into the field of the atoms. It is that Y vector which will quickly lead to much increased repelling force, and this force will be perpendicular to the (idealized) relatively smooth planar field made up by all the electromagnetic clouds of all the wall atoms. Hence the overall, statistical, macro force on all the iron atoms is very much predominantly straight along the -Y vector.
The rest follows from conservation of momentum. As there is only very little affecting the X momentum, it will be unchanged. Watched from straight on, the ball will move along the wall just as before the collision. But the Y vector must reverse since those materials do not intersect easily, and we didn't use enough force to make the iron ball actually disturb the wall. So it bounces straight up in the Y direction, while flying unchanged in the X direction, which leads to the effect you are asking about.