Germany had good reason to be paranoid. They were surrounded by a powerful alliance between Britain, Russia, and France, all of whom were scapegoating German ambition to help with their own political problems. Archduke Ferdinand's assassination was just a crystal falling into a supersaturated solution. When Russia demanded action from its allies in support of their ally, war was inevitable. At that point, Germany declared war on Russia only to get the first strike in, before Russia could fully mobilize France and Britain against Germany as well.
When you find yourself surrounded by enemies, you might ask yourself how it came to be that all your neighbors turned against you.
An Anglo-French alliance was not inevitable; as late as 1894 it was possible to publish a novel in which England, invaded by France and Russia, was rescued by Germany [1].
"In the European Union, treating World War I as the product of abstract forces like arms races or nationalism is doubtlessly useful in minimizing national animosities.
But unlike the chattering classes, most historians, ever since Fritz Fischer published Germany’s Aims in the First World War (1961), have tended to agree that the major cause of World War I was Imperial Germany’s determination to become a “world power” or superpower by crippling Russia and France in what it hoped would be a brief and decisive war, like the Franco-Prussian War of 1870-71. Following the Archduke’s assassination, Berlin deliberately used the crisis in relations between its satellite Austria-Hungary and Russia’s satellite Serbia as an excuse for a general war that would establish German hegemony from Belgium to Baghdad. World War I started in 1914 for the same reason that World War II started in 1939—a government in Berlin wanted a war, though not the war it ultimately got."
Additionally, Austrian historians claim that Austrian military strategists also surely didn't want the big war but just to attack Serbia which they estimated was already weak enough to be an easy target. Both Germans and Austrians simply (stupidly?) expected much less response from other countries.
In a sense he was, as my impression is that his uncle, the emperor of Austria-Hungary, and government had been looking for a reason to stomp Serbia into submission for some time. One that they hoped would not get the Russian Tsar riled up...