Well, first of all, I'm not sure it did, actually. While the phrase "total war" only emerged as a term in the late 19th and early 20th centuries, seeing wide use for the first time in WW1, the killing of civilians in wartime has been a constant occurrence throughout human history.
Honestly I think this term has more to do with illusions that people in the early 20th century had about the "honor" or "chivalry" of Medieval warfare (cultivated by Medieval leaders and historians, of course), giving them the sense that in those "good old days" soldiers used to fight with honor and only killed other soldiers. The facts are nothing of the sort; rates of civilian collateral damage have been constant or falling throughout history. WW1 was unique in terms of its total number of deaths in a single conflict (a record then broken by WW2); but in terms of total homicide deaths per million population per year, even the World Wars do not contradict the trend of overall declining human violence.
It could also, counter-intuitively, have to do with the advances in moral development made during this period; while civilians had always been killed, it was not until the 20th century that people began to be upset that civilians were killed. This is a general pattern: As the world gets better, people keep saying it's getting worse, because our moral standards rise faster than our actual behavior---but our actual behavior does in fact improve.
That said, there was a strategic reason why total war was used as a strategy in the 20th century despite widespread moral opposition. The World Wars were the first wars that were more dependent upon industrial technology and materiel production than they were on sheer size of army. For most of history, the side with the most soldiers usually won, except if the other side had particularly brilliant commanders (e.g. Alexander of Macedon, Napoleon). But in the World Wars, the number of soldiers was almost irrelevant; a single bomber with half a dozen men inside could destroy an entire infantry division of several hundred. What mattered instead was industrial capacity.
And industrial capacity, of course, is a civilian activity. It was civilian workers who built and operated the factories that made tanks and bombers. Indeed, in the US in WW2, it was primarily women, and our unique willingness to employ women in our factories was part of our overwhelming industrial advantage in the war. Japan could not have matched us industrially even if they had employed women, but their refusal to do so put them even further behind than they would have been, effectively cutting their labor force in half.
Because industrial capacity was so important in the World Wars, many commanders---on both sides---employed tactics such as "strategic bombing" (carpet bombing of cities) designed to disrupt industrial production and infrastructure, regardless of the enormous civilian casualties that resulted. The atomic bombings of Hiroshima and Nagasaki were particularly dramatic examples, but more people actually died in conventional "strategic bombing" of cities such as Tokyo and Dresden.
We could imagine that maybe if civilian industry hadn't been so important for the war effort, these tactics might not have been employed... but honestly, I'm not so sure. Like I said, soldiers have been killing civilians for thousands of years.