Should academic papers necessarily carry a sober tone?
Are jokes or anecdotes fine as long as they do not appear forced?


To me, there is a single measure for this: does a sentence X contribute to the paper, or not. If the answer is no, it shouldn't be there at all. 

To apply the principle to the joke: if the joke illustrates a common problem which needs a solution, or illustrates a common (perhaps insufficient) solution to a well stated problem, then it certainly has a place in a research paper.

I understand scientific writing as a form of literature. I do not see any reason for literature (including scientific discourse) not to be entertaining as well, when appropriate. But everything has its time and place. However, it shouldn't be forced and has to fit the main contribution of the paper, hence the filter rule above.