Germany's monarch, Kaiser Wilhelm II, took his kingdom to war in August 1914 to defend it, and defending the Fatherland was what the German people thought their country was doing. They supported the war believing that Germany was defending itself from Russian, French and, later, British aggression.
The plan of Germany's General Staff – the Schlieffen Plan – was a mistake. It's purpose was to strike France through Belgium – the shortest and quickest route to Paris. It was a plan created in the belief that offensive warfare was superior to defensive warfare. Germany's chancellor excused the Schlieffen Plan with an absurdity: that Germany was "in a state of necessity and necessity knows no law." Marching through Belgium contributed to Britain entering the war, which would play a role in the US entering the war and Germany's eventual military failure.
In the first month of the war was over, Germany was successful in its defensive strategy against Russia, smashing the Russian offensive into Germany in late August at Tannenberg and the Masurian Lakes, just a few miles inside Germany's border, securing that border for the remainder of the war.
Against the French the Germans were more successful in their offensive than were the French in their offensive against the Germans, and this left them on French soil as the superiority of defensive warfare produced stalemate. Unfortunately, against France and Britain the Germans had a passion for revenge and military victory. This prevented them from correcting their mistake. They would have been better off it they had negotiated a withdrawl back to Germany. Their passions led them to reject what they called a "rotten peace" – a compromise settlement. They wanted the 300,000 or so German military men already killed by November 1914 to account for something. That number would increase to 1.7 million by the end of the war in 1918.