My interpretation is that it would take damage once for that movement.
When the monster first enters the flame (second diagram), it has entered the wall's space and takes damage.
In the third diagram, the monster is not "moving into the wall's space" because it is ALREADY in the wall's space.
So far as the 3-square movement penalty is concerned, the monster would only take that once when it first entered the wall (second diagram). As it continued to move through the wall (third diagram), it would no longer receive the penalty. This is based on the rules for hindering and difficult terrain for large creatures on page 284 of the PHB.
Does a large monster take damage for both being adjacent to the wall and inside it at the same time? I would say no. My reasoning would be that a medium creature doesn't take both forms of damage, despite being adjacent to segments of the wall... The large creature is just as "within" the wall as the medium creature. But that's a MUCH fuzzier ruling.