What I cannot understand is, why do they get bonuses when the company is failing, I always thought that you got bonuses for doing good things for the company.

The CEO trail is just one big "Old Boys Club" they go from one company after another picking up more and more money as they go.
Why must the remuneration package only approved by the board and not the Share Holders