Poorly is not quite as intense as very badly.
I disagree that there is anything unusual about the use of very badly in this context. It leaves me under no confusion.
You are correct about the wall being wrong. I didn't notice it. 'A wall' is obviously correct.
The lack of 'to die' removes emphasis. It is obviously not seriously said but merely to reinforce the level of regret.
I doubt that the person would do more than tap their forehead on a wall so the whole sentence is rather fanciful.
Now that you mention it there is an extra he. The second is redundant.
He taught very badly that morning and just wanted to beat his head against a wall and die.