As the preceding answer suggests, the phrase "war to end all wars" was first used by H.G. Wells. Wells, like many idealists of his time, hoped that the sheer destructiveness of the First World War, unprecedented in its time, would persuade mankind to abandon war as a means of solving political disputes.
Many agreed, most notably including President Woodrow Wilson, who argued that the war could become a catalyst for promoting democracy. He famously called the conflict a war to make the world "safe" for democratic institutions. In order to make this happen, Wilson thought the war needed to end in a "peace without victory" in which the powers involved in the conflict would agree on a negotiated peace. Wilson, like many others, thought that the specter of communist revolution, as seen in Russia, would persuade the powers to come together. Wilson went so far as to issue "Fourteen Points" upon which any lasting peace had to be based. In particular, he advocated for an international organization meant to keep the peace.
In the end, the hope harbored by people like Wells, Wilson, and many other politicians and intellectuals would not be realized. Despite the destruction wrought by the First World War, which destroyed generations in the belligerent nations, perhaps the greatest tragedy of the war was that it paved the way for an even more destructive conflict less than three decades later.