There's a good argument to be made that the Great Depression caused WWII. The German Republic was brand new, and the economic devastation was far more than its tenuous prestige could support. As an alternative, extremist parties like the communists and the Nazis, neither of which wanted a Republic at all, were greatly strengthened. In the 1930 election enough Germans voted for the anti-republican parties that it wasn't possible for the Republic to create a government without them. The Nazis were invited into the government, and Hitler's ambition did the rest. In happier economic times this would not have happened.
WWI on the other hand, was mostly the result of the surpassing incompetence of the German monarch, Kaiser Wilhelm II. Here's an excerpt from his wikipedia page to give you an idea:
German foreign policy under Wilhelm II was faced with a number of
significant problems. Perhaps the most apparent was that Wilhelm was
an impatient man, subjective in his reactions and affected strongly by
sentiment and impulse. He was personally ill-equipped to steer German
foreign policy along a rational course
He fired Otto von Bismark, easily the most talented German politician and diplomat of the age (in fact, the man responsible for there being a German Kaiser in the first place), and instead surrounded himself with people who could be counted on to tell him only things he wanted to hear. The subsequent disconnect from reality had rather sad effects.
The spark that started the war happened in Austria-Hungary. But rather than try to contain things, Wilhelm at every stage fanned the flames. He became convinced that Russia, France, and England were all in cahoots against him, and then proceeded to take pre-emptive measures that ensured that in short order they were.