The enotes link below provides a comprehensive discussion of the important themes Steinbeck touches on, including loneliness, the importance of friendship, and the American Dream. Because I cannot improve on the arguments already provided, I will go in a different direction and attempt to get to the heart of Steinbeck's philosophy of life as a theme in this book. As he implicitly argues in his best works, The Grapes of Wrath and East of Eden, humans are driven and often foiled by both genetics and environment. They rarely escape their individual circumstances. There is no happy ending for people whose lives are pre-determined. It is an age old argument between free will and determinism. In Of Mice and Men, Steinbeck opts for the latter view of life.
Lennie is incapable of escaping his obsessions and his lack of restraint when tempted. He is born mentally challenged and unable to grapple with his problems. George knows he is limited by his relationship with Lennie and his own shortcomings, but like all humans he still has his dreams. He even admits that he knew things would never work out after Curley's wife is discovered dead. It is not surprising then that Steinbeck took his title from the Robert Burns poem, "To a Mouse" with the telling lines, "the best laid plans of mice and men often go astray."
Steinbeck even suggests in this novel that humans are similar to animals in their lack of free will. In chapter five Steinbeck makes reference to both a dead puppy and the horses in the barn. Lennie's killing of the puppy directly foreshadows his accidental killing of Curley's wife. Curley's wife is no more capable of controlling her fate than the animal. Likewise, Lennie is trapped like the horses who rattle their halter chains. He will continually do "bad things" because he is genetically programmed to do so and his environment provides too many temptations.
Other characters are also figuratively trapped. Crooks cannot escape his race and the prejudice he faces. Candy is victimized by his disability and impending old age. Curley needs anger management classes but lives in a time and environment where a sober analysis of his problems is impossible. Curley's wife is the victim of misogyny and reacts in the only way she knows how, by flaunting her sexuality. Even Slim is caught in this world where dreams are limited. Fortunately for him, he is ever the realist and faces his plight with wisdom and dignity (his character is similar in temperament to Lee, the Chinese servant in East of Eden). Steinbeck, as he often does, teases the reader with a glimmer of hope in the end of the book as he has George and Slim leave together from the spot where Lennie is killed. Maybe they will strike up a friendship and realize their dreams. The reader is not sure. All that can be concluded is that humans will always strive to exert their will on the world no matter how futile that effort proves to be.