Even for the darkest of pessimists, when the great powers of Europe went to war in August 1914, their troops were supposed to be home by Christmas.
"It will be a very short war -- a month, six weeks, perhaps," a French lieutenant, Charles Delvert, recalls a comrade telling him at the outset of the conflict.
"'No', I told him, 'It will be a drawn-out war -- at least three months,'" he writes in his diary.
How high ranking officers could be so credulous?
I am going to give you a slightly different account from /u/secularstudent, and will be focusing only on the western front. Martin Van Creveld in Age of Airpower gives a good account of an often overlooked aspect of the outbreak of hostilities--reconnaissance. In addition to the time-honored practice of using observers on horseback, the beginning of WWI saw a new method. In an airplane, a pilot (or a pilot and an observer) could roam the skies at whim relatively free from danger (effective measures to bring down observers would only come later). These observers were able to map out the movements of the German forces (and indeed the Allied forces as well) and relay them to the opposition's command.
Now comes the other side of my argument, this time from Christian Wolmar's Engines of War. Once spotted, the usage of trains to transport troops and supplies was critical for both sides. The advancing Central Powers had the difficulty of moving further and further from their railheads, and had to keep moving their logistical base forward. The defenders were able to use their own rail lines to pour troops into areas where they were most needed, and could concentrate their defense at points that were serviced relatively well by rail lines. The speed of trains allowed the defender to have just enough of an advantage to blunt most any advance by the attacker.
After being spotted from the air, an attacking force (or later a buildup of troops and supplies for a future attack) was quickly countered by fast-arriving troops on trains. Now the things that /u/secularstudent mentioned come into play--the armament, tactics, and terrain that favored the defense at the time meant that rapid advances (again, in the west) were extremely difficult. Hence, a rapid end to the war was not found.
My first crack at r/askhistorians so here goes.
Every war ever fought has had the same sentiments from troops like this. During the American Civil Was the first battle of Bull Run civilians actually watched the battle and ate each side expecting the war to be over very quickly.
That being said WW1 was really the first big "modern" war with the use of long range artillery, machine guns, tanks, gas, telescopic rifle scopes and bolt action rifles. So early in the war and really during the entire conflict the military generals used napoleonic era tactics and even cavalry during the onset.
The generals had no idea how to fight this kind of war. Their formerly very effective cavalry units were mowed down by the maxim machine guns each side used. And the snipers in "no mans land" made even sticking your head up a possibly deadly decision.
So the sides built trenches to protect from snipers, artillery and machine guns. The Central powers (germany, austria hungary) built very meticulous trenches with 90 degree angles and floors in them because they understood this was going to be a long war. The Entente (britain, france) built shoddy trenches expecting the war to not last very long at all.
The tactics used were basically human wave style and the side who could throw more men at the other side were generally more likely to win. But that caused huge casualties since the trenches defenses were so formitable. So during the war the lines did not move very much at all. So the winner would be decided by witch countries would give in first.
The entrance while disputed of the US into the war really helped the Entente with a huge surplus of fresh troops and supplies.
Sorry for the really long explanation buy I hope this helped answer your question the whole the war will be over in months phenomenon has happened since the beginning of time even in the beginning of the US involvement in Iraq and Afghanistan. If you really want to understand the psyche of the WW1 soldier read "All Quiet on the Western Front" it does a fantastic job illustrating everything I laid out and more. Sorry for any typos.