Nonsense poems
Nonsense poems, of which Jabberwocky is one, became popular in Victorian society. As Victorian society was very strict, it wasn't possible to criticize social habits and etiquette directly.
By using nonsense words, Lewis Carroll and many other writers at the time were able to make fun and question many popular ideas without saying anything directly. Nonsense poems can be understood in many different ways, because they never refer directly to what they are really about. Sometimes they really were just nonsense, and pure entertainment.
This was made possible by the increasing popularity of children's literature. Many more children were able to read in the Victorian era, so it became possible to write books just for them.