High level execs at public companies have certain standards to maintain at all times because they are the faces of the company. They get tons of media training, and are taught how to act in public, particularly with a camera in their face.
Regardless if the joke was funny or the punishment was too harsh, he failed at one of his basic duties to represent Apple. Some may say that's unfair in his 'off' time, but it's par for the course as a high level exec in a big company and one of the many reasons they are paid so much.