Ultimately, Louis XV and the complacency with which he ruled from Versailles during the middle of the 18th century. Around the time of the French Revolution, we all know what happened there (and for the most part, why), French nationalism was viewed with a great deal of misapprehension by all the powers that surrounded France, most notably Austria and the UK (Prussia and Russia to a lesser extent). Come the rise of Napoleon and what he did to central Europe left a lot of Germans feeling bitter towards French unity and its political effects on the remainder of Europe. Then, because of the ideals that fomented as a result, we have the Revolutions of 1848 and the inevitable spread of German nationalism which played Prussia and Austria against each other for dominance over the German speaking parts of Europe. And enter the troublemaker-general, Otto von Bismarck, who I maintain was responsible for both the rise and the fall of the German Empire. With his machinations, Prussia and Austria allied to destroy Denmark (sort of) and demonstrate the Prussian military machine to the rest of the world (sort of). The Austro-Prussian War confirmed the northern Germans' strength and would ensure a Kleindeutschland Losung end result. However, Bismarck played, perhaps without fully realising the consequences, the Crown Prince Frederick against the Prince William (the third and final Kaiser) guaranteeing that Wilhelm II would be a reactionist, nationalist and xenophobe. Basically, Bismarck would ensure that the son would be as different from the father as he could be. The 'old guard' of Prussian gentry were very anglophilic, so if they had survived to maintain influence, Frederick III, von Moltke the Elder, von Blumenthal and few others could've made the Reich more liberal. But, as I mentioned, Bismarck was a troublemaker and Wilhelm repealed virtually every law his father passed (what few of them, anyway, I don't think many of them even made it to 'white paper' status).
Anyway, moving on... or perhaps back to what I consider the intermediary cause: French public reaction to the loss of the Franco-Prussian War. I personally feel that France had no right to complain after losing (think of Prussia after the Fourth Coalition!). France declared the war and effectively lost within three months. Taking Elsass-Lothringen was not unreasonable as the ethnic groups there (particularly in Elsass) were more German than French (though not strictly speaking either) and the indemnity demanded was peanuts compared to the WWI one levied against Germany. But then, here again is another fault of France insomuch that the Bourbon successors were so crappy that they were easily toppled by Napoleon III.
As for the lead-up to WWI, ignoring all that I've mentioned, the only major player who can't really be blamed is the UK. Edward VII played a good card by making (politcal) peace with France in 1908 (I think) and merely kept the RN's tradition of being the most powerful in the world. Germany alienated everyone who didn't speak German, Nicholas was an idiot (losing to Japan... twice) and just shrugging it off, France kept tub-thumping about regaining Alsace-Lorraine (and both sides exacted rather violent reprisals against each other, though debatably France was ultimately a lot worse), and Austria-Hungary was by then an impotent nation, incapable of keeping her provinces in line. They would need a war with a powerful ally to reaffirm their position in Europe as a major power.
The immediate (military) blame lies with Russia. Their military (with the exception of the Moskva Guberniya based elite units) was in a shit state and Nicholas II's decision to mobilise spelled the end of three monarchies. Germany was young and still unsure of itself, for all Wilhelm's ambition (he still had aspirations to a colonial empire, laughable as it may seem now), and until 1905 had little intention of going to war with anyone except France. Had Russia not mobilised, Germany would've left Austria to deal with the Slavic insurgents by themselves while still eyeing the French warily. Who knows, if Austria fucked it up enough, Germany might've invited them to rejoin the Zollverein!
So, who do I blame again? Frederick III for smoking so damned much!