Humor can be used as an icebreaker near the beginning of a speech to put both the speaker and the audience in a more relaxed frame of mind. It can be effective as a closer to ensure that the audience leaves on a happy note. It can be used throughout a speech to help the speaker make points and to make the points more memorable.
Using humor can help a speaker make a point on a sensitive subject. Texas Governor Ann Richards, keynoting the National Democratic Convention in 1988, used humor to get in a plug for women's rights:
But if you give us a chance, we can perform. After all, Ginger Rogers did everything Fred Astaire did. She just did it backwards and in high heels.
That was the same speech in which Mrs. Richards said ...