One of the main functions of humor in Zen is in trying to allow one to understand the absurdity in attempting to classify reality into categories. Thus, the boundaries formed between logical issues are broken down, revealing the frustration that Zen has with logic and reasoning.
An example of this can be seen in a Zen anecdote about a Zen master who lay dying. His monks are all gathered around his deathbed, and the senior monk leans over and asks the master for any final words of wisdom for his monks. The old master weakly says, "Tell them Truth is like a river." The senior monk relays this message on to the other monks. The youngest monk in the group is confused, and asks, "What does he mean that Truth is like a river?" The senior monk relays this question to the master, and the master replies, "O.K., Truth is not like a river."
We see here a serious message wrapped up in a humorous package. The absurdity of classifying things into little boxes is revealed here: Truth is and is not like a river; it transcends classification.