Hello NamLan! Welcome to the forums!
This sentence would sound a little bit awkward to a native speaker.
I would say it like this:
He taught very badly poorly this morning and he just wanted to beat his head against thea wall to die.
While very badly is common, it isn't proper English.
Usually the expression is to beat one's head against a wall
The to die part is a part of that expression that I haven't heard, and I think it is unnecessary.
You could get rid of the just as well, but I think it is ok if it stays.