Countervalue bombing by airforces (that's bombing of civilian targets, as opposed to counterforce, the bombing of military targets) was a natural and unavoidable outgrowth of the revolution in war which came about in the late nineteenth century and showed its immense destructive capacity in the twentieth. The Napoleonic Wars had shown how powerful a single nation could be when it turned all its energies to the task of war, and technological advances in the nineteenth century were making this increasingly seem to be the only way nations could hope to compete with each other. After Prussia deployed 1,200,000 men against France in 1870 - double the number Napolean had led to their deaths in Russia - the importance of strategic rail networks and an economy geared to putting the most men on the front line was recognised. In the future war would not be a limited affair taking place between elites isolated from the rest of the population, but a contest of entire nations.
The advent of aircraft during World War I precipitated a revolution in the ability for a nation to strike directly at the economic and psychological heart of another. At first the possibilities weren't realised, and aeroplanes were primarily involved in destroying each other so they could peacefully go about their main task, which was reconnaissance on the battlefield. No-one thought aircraft could sink ships at sea. But as technology raced ahead and the range and destructive capacity of aircraft increased, enthusiasm for air power swung entirely the other way. Strategic bombing would make land war obsolete, it was said - hadn't the Great War proved the futility of trying to decisively win a war in the new climate? World War I was seen to have ended because the populations of the Central Powers decided that enough was enough and gave up (on the other side, this is certainly what compelled Russia to sign Brest-Litovsk). The new centre of gravity was the civilian populations, not the armies.
Countervalue bombing was a way to destroy the will of the enemy society and force it into submission. Although it may seem strange for us to understand this now, this was seen as more humane than "trenching" ala World War I. It was assumed that strategic bombing could achieve such unimaginable destruction in a short space of time that the war would end quickly, and no long process of attrition would be needed (such was the logic behind the nuclear drops on Japan). Rather than wearing down each other at the front lines in a process which did as much harm to the attacker as to the defender, it was better to attack the new centre of gravity directly. Furthermore, it was hoped that the possibility of such immense destruction would stop wars getting "hot" - the deterrent effect of the bomber fleets would be enough to make everyone want to avoid wars altogether, as does nuclear deterrence.
When World War II came, there was very little countervalue bombing in the first year. The Royal Air Force simply did not initially have the military capability to bomb the German heartland, and until 1944 it inflicted very little damage on German production. The Germans, on the other hand, were more interested in tactical bombing to help make their audacious blitzkreig work. The people who had predicted that strategic bombing would bring about immense destruction were proved right when the United States Air Force and Royal Air Force gained a sufficient degree of control over the German skies to bomb with impunity, but the development of countermeasures and a battle of technology stopped such total destruction earlier in the war. Nor did the bombing campaigns have the expected effect on civilian populations - it tended to embitter them more and tie them to their government and the war even more. Now the people at home were in danger as before only soldiers had been, and this tended to radicalise them.
The bombing of civilians by air forces turned out, then, to largely be a failure. Air supremacy of the sort needed to inflict huge destruction on enemy cities was rare and unlikely to seriously harm production or morale if achieved - but to some inter-war strategists it looked like an essential part of any future conflict. Total wars which involve every member of society in them necessarily transform every citizen into a "soldier" in the war effort - be she a potential mother of young men or he a lathe operator in a munitions factory. The immense destructive power that lurked within the European family of nations, when unleashed and tied to nationalism, saw the bombing of civilians as an essential part of the attrition process. When powerful nations came into conflict they had to be worn down in some way - and the very threat of the bombers was enough to aid Hitler in implementing his policy in dealing with his immediate neighbours.
The age of European wars now seems to be over, and no two powerful societies have been required to attrite each other as happened in the World Wars ever since. Strategic bombers are now largely a thing of the past. Precision strikes as implemented by NATO or the USAF when dealing with poor countries that lack air power (Iraq's air force was the fifth largest in the world, but the USAF decimated it quickly and achieved total air superiority) do still target civilian infrastructure, however. This sort of bombing, developed into the doctrine of "shock and awe bombardment", aims to achieve the capitulation of the enemy's military with limited contact between ground forces. Although the death of civilians still occurs, this bombing is different in kind to carpet bombing, as it aims at direct military goals rather than a fundamental attack on the morale of the target society, which would militarily be unable to match the forces of the richer nations even if moved to do so, and so is largely irrelevant.