In the 19th and the early 20th century, wars in Asia and Africa were a relative cakewalk for the Europeans (even when fighting modernized enemies like the Boers). After WW2, the french wars in Indochina, the Algerian war, and later the US campaigns in the Middle East have become constant, bloody, expensive guerilla wars with no end in sight. What exactly has changed?
The problem with your question is that the initial premise is wrong. 19th and early 20th century conflicts in Asia and Africa were not the cakewalks we imagine them to be. Although 20th century popular culture has often portrayed conflicts between European powers and the inhabitants of colonies and regions intended for colonization as short and relatively inevitable in a white, European victory. The most representative example of this would be the Anglo-Zulu War of 1879, arguably the most well-known colonial conflict in the popular imagination of the west. Even in the crushing defeat of Isandlawana, the layman knows that there will be a European victory shortly afterwards in Rorke's Drift.
But let's take a step back. First and foremost, we have to establish the fact that we are dealing with not only different centuries, but also different types of conflicts. The Anglo-Zulu War was what we would call a conventional war. What this effectively means is that the war was fought by primarily conventional, "normal", tactics and strategic thinking. Two conventional armies fighting against each other with the intent to defeat the other in a set-piece battle. The kind of war we think of when we, for example, imagine the Second World War or more suitably for the period, the American Civil War. Throughout the 19th century in both Africa and Asia, several conventional wars did occur between colonizers and the would-be colonized. One such war for example, the First Italo-Ethiopian War in 1896, effectively prevented the colonization of Ethiopia by Italy.
But more frequently, colonial wars and wars of conquest were not strictly conventional. Many were unconventional, in which the European powers had to subdue forces who were using guerrilla warfare, or a mixture between the conventional and unconventional. This also characterizes the conflicts you refer to in your question. The Indochina War, the Algerian War, the Vietnam War, The Malayan Emergency, the Portuguese Colonial Wars, etc. were all unconventional conflicts or a mixture between the two. The reason for why unconventional conflicts can drag on for so long is based in the fact that it is unconventional. Unlike the conventional war, the unconventional or asymmetric war will have one side who doesn't want to face the other side in open battle. Instead, the side that utilizes guerrilla warfare will try to survive and outlast its opponent to the point where the opponent has to give in, give up and/or leave. This is a simplification, but it needs to be understood that we are talking about different approaches to winning a war.
This brings us back to your question. Why "have wars in Asia and Africa become so bloody and difficult for the Europeans after WW2"? Because they were equally as bloody and difficult for Europeans before WW2. The initial French conquest of Algeria took more than 15 years to accomplish. The French conquest and subsequent pacification of Indochina began in the late 1850s but lasted well into the early 20th century. The five Xhosa wars that the British experienced in modern-day South Africa between 1811 and 1879 pale in comparison to the fact that colonists in the Americas fought long wars to subdue their native populations, some beginning in the 16th century and not "winning" until the 19th and into the 20th century. These are only some conflicts in Africa, Asia, and the Americas that can be mentioned in this context. Additional conflicts ranging from Bosnia to New Zealand can be added onto a very extensive list of unconventional conflicts that were far from a "relative cakewalk". Furthermore, these conflicts were equally as physically and psychologically straining for the soldiers fighting in them as they are today. Let's consider the following quote from a soldier fighting in Indochina:
"The ambushes and the constant shots fired from the side of the road unsettled us to the point where all thoughts of mercy disappeared. An open battle does not create the same feelings of hate and vengeance. For months you've been in constant strain to be killed in an ambush like an animal, each minute you have to think that there are enemies all around who are just waiting for you to pass by. Constantly these sounds of shots being fired on a very short distance and that makes your ear ache! All human emotions disappear and you are taken by rage. You lose the ability to see the conditions clearly, to see them as they really are."
This quote could equally have been uttered by a French soldier in Indochina in 1952 or an American soldier in 1969. Instead, it was written by Swedish French Foreign Legionnaire Martin Sandell in 1901 while fighting in Laos.
Sources:
A good introduction source to the scholarly study of guerilla warfare in history is Modern Insurgencies and Counter-Insurgencies: Guerrillas and Their Opponents since 1750 by Ian F. W. Beckett. The quote above is from Bertil Nelsson's Breven från Tonkin: En svensk främlingslegionär i Indokina.