Having a sense of humor in otherwise "serious" situations is important. Like when you visit a sick friend in the hospital and they're doing their best to keep the mood light and not cry all over the place. The fact that they're willing to crack jokes in the most dire of circumstances shows real strength.
I'm not saying you'd want your doctor making a joke when they're telling you that you have cancer or something, but it's good to try and lighten the mood when appropriate, especially in certain professions.
This is especially true of police officers. Because, depending on your personal experiences with cops, these guys can get real scary and real un-funny, real fast. But the fact that some cops are able to joke around portrays them in a more humanizing light, and because of that entertainment value, you'll be more likely to cooperate with them and turn to them for help.