What does the joke Why did the Chicken or hen cross the road mean?

Explaining a joke kind of takes a lot of the funny out of it, but here goes.

The standard form of the joke is "Why did the chicken cross the road? To get to the other side."

The humor comes from the fact that, if it weren't for the fact that nearly everyone who speaks English has heard it, the setup sounds like a riddle, which means a person hearing it for the first time would probably expect that it has some kind of complicated answer, when, in fact, it's the very simple and obvious explanation of "to get to the other side."

However, since everyone has heard the standard version, sometimes people will try (with varying levels of success) to reintroduce the humor by changing the answer.... again, this relies on denial of expectations. If you expect the answer will be "to get to the other side" and it turns out to be something else, then maybe you'll find it funny again. For this to work, it has to be set up so that you have some clue it might be a different answer, or it's just a non-sequitur, which may or may not be funny depending on the circumstances.