World War 2 had its roots in World War 1: the latter can be seen almost as a direct continuation and evolution of the former.
While the reasons are varied and numerous, I would point most distinctly to the nature of Germany's loss. The Versailles Treaty enforced objectively harsh and unfair terms on Germany, forcing it to accept blame for the entire war, crippling it with obscene fees and tariffs. The postwar economy was unable to recover under these circumstances. Secondly, the social perception of the armistice among Germans was far from positive. They perceived that they had been betrayed by left-leaning ideological traitors, and the postwar nature of cities such as Berlin, which became inconceivably decadent and "degenerate" by traditional standards, were seen as a subversive attempt to distract the population while making Germany susceptible to anarchists and communists.
Germany's economy in the 1920s was, simply put, awful. It had no means of repaying its debts, and inflation virtually destroyed the value of its money. The American Depression, by virtue of its loans and trading ties with Germany, further cut into its recovery.
With the political machinations that allowed Hitler and the National Socialists to come to power, significant reforms took place. Hitler recognize the immediate need to change the economy, and the public desire for stronger, centralized leadership. I identify three significant factors that took Germany out of its postwar slump: the cutting-off of international trade and directing Germany toward self-sustenance, the rearmament of the military, and the remilitarization of the Rhineland.
Cutting off trade and instituting public works projects contributed to decreased economic problems, and rearmament suggested that Germany would no longer subject itself to the guilt-complex foisted upon it by the Allies. However, the Rhineland was what really revealed a path from recovery to war.
Following WW1, the League of Nations was intended to intervene in future conflicts and prevent them from escalating into a similar war. However in practice, the League was practically useless, and this weakness was immediately recognized by aggressive powers of the time, and the League tended to be ignored. This led to most countries returning to foreign policies centered around their own self interests. When Germany reoccupied the Rhineland, this was a direct violation of the Versailles terms, but France felt it could not afford a war over this (keep in mind also that most countries were war-weary and didn't want to start another one). Britain was also more sympathetic to Germany and felt that the Germans were entitled to militarize their own land. The policy commonly known as Appeasement, in which European powers appeared to be complicit in German aggression, was in fact the best option for their leaders at the time, without the public support or military power to act as they pleased.
Allowing Germany to remilitarize the Rhineland sent the message that Britain and France, at least, were extremely wary of showing aggression to Germany, which put Germany in a position of power. Additionally, the only state which really opposed Germany's policies was Russia, and most of Europe feared Russia more than Germany, weakening any possible union that might have stamped out German aggression earlier. This led to Germany's perception that it could execute the same thing in Czechoslovakia and Poland, which led to the outbreak of war.