Upton Sinclair, the author of The Jungle, was a well-known socialist. In The Jungle, Sinclair is reacting to the ideas of social darwinism or the idea that those who are successful in society are those who are the most fit to survive. This idea was popular during the time Sinclair was writing his novels and The Jungle is meant to show the pitfalls of Social Darwinism's beliefs. The people who survive in his novel are not necessarily the most fit, but the most corrupt and brutal. The Jungle metaphorically paints a picture of the economic situation Jurgis and his family face in the Chicago meatpacking plants. They are treated like animals amid terrible working conditions and a system which preys on naive immigrants. The houses they buy are substandard; they catch diseases from the poor sanitation in both their neighborhoods and working places, and often lose both their jobs and their lives simply trying to support their families. The book was supposed to show people the advantages of a socialist system where workers would be protected. However, the novel was more successful at changing people's minds about the way meat was processed. As Sinclair said, "I aimed at people's heads, but hit them in the stomach."
The metaphor recalls the "law of the jungle" where survival by all and any means is what controls behavior. It is also a metaphor for the city, where things are impersonal, people do not get to know each other, and live is generally hard, to say the least. Jurgis, the main character, comes to the city a healthy young man, willing to work, to do what he has to so that his family will have a good life. Instead of the chance to realize the financial dream of America, he meets totally intolerable work conditions in the slaughter house, gets laid off when business is slow, sees his wife raped, assaults the man who raped her and goes to jail, gets out of jail time to see his wife die in childbirth, sees his son drowned in a street flood ... well, you get the picture and can get additional examples at the enote site below
Since Capitalism is presented as a jungle where the economically weak have little chance at success, it is no surprise that, at the end of the book, we find Jurgis looking to socialism for answers. This provides an interesting link to today where we seem to be electing socialism as an answer to our economic "jungle."