Several different aspects went into writing the song - for a good breakdown go here because I am only focusing on a few. First of all, part of the inspiration for this crazy song was a letter John received from a student at his old school telling him that a teacher had the class analyze the Beatles' song lyrics. John decided to give them a song that they couldn't possibly analyze. I think this is pretty interesting and possibly a window into what some authors and songwriters feel about all the attempts at analysis and trying to discern what caused the author to write what they did. I'm not saying it's a bad thing to do, even if the author doesn't like it - once they release their work into the wild people will have their own experiences with it that may have never entered the mind of the creator. But I like John's little plan of messing with the analyzers is pretty amusing.
Secondly, the title of this song comes from Lewis Carroll's poem "The Walrus and the Carpenter" in Through the Looking Glass. I won't put the whole poem here because it is very long, but click on the link if you'd like to read it. It is the poem containing the famous lines, "'The time has come,' the Walrus said,/'To talk of many things:/Of shoes--and ships--and sealing-wax--/Of cabbages--and kings--/And why the sea is boiling hot--/And whether pigs have wings.'" In this poem, the Walrus and the Carpenter coerce some little oysters to run and do their bidding so they can eat them. Allegedly Lennon did not realize that the Walrus was the villain in the poem until after he wrote the song, but decided to keep it anyway. Some have said Carroll's poem was a commentary on capitalism - I honestly didn't read it thoroughly enough to get that, and Carroll himself never specified that it was meant to be a political tirade. (All this information is straight off wikipedia, the information bank for the lazy, so if any of you have more reputable sources or information I would love to have it!)
I found it interesting enough that the inspiration for the Walrus was literary, but it was even more interesting to me when I found references to the song in Salman Rushdie's Haroun and the Sea of Stories (review forthcoming). Haroun travels with Iff, a Water Genie, to the land of Gup in hope of saving his father's story-telling ability and meeting with the Walrus, director of the house of P2C2E (Processes Too Complicated To Explain). The Walrus' facility is peopled by Eggheads, bald people in white lab coats who scurry around working on the P2C2E machines. At first I wasn't quite sure if this was a real reference because it seemed too ridiculous to be true, but when I came to the sign on the Walrus' door ("GRAND CONTROLLER OF PROCESSES TOO COMPLICATED TO EXPLAIN. I.M.D. WALRUS, ESQUIRE. KNOCK AND WAIT") I almost clapped my hands with happiness at how absurd it was. The Walrus also introduces his team by saying, "They are the Eggheads. I am the Walrus," very similar to the song.
I thought it was awesome and hilarious that the song was being used in this way in Haroun and the Sea of Stories, but I was even more struck with it when I learned that Lennon's inspiration for the song partially came from Through the Looking Glass, because Haroun really reminded me of Lewis Carroll's two Alice books. It is crazy to me how all these different ideas made a circle. I don't know if Rushdie intended to complete the circle or not, but it was striking to me.
So there you have it - my own (short) literary analysis of one or two lines of "I Am the Walrus." The video at the bottom has all the lyrics - feel free to offer any of your own interpretations.