Truth is I had my own idea of why cooking arose before I posted, but wanted to offer up a question rather than just offering my thoughts. But now it seems reasonable to offer.
The Origins of Cooking paper written by folks here (which I can't seem to find again) claims that cooking originated in the range of 100,000-300,000 years ago. This is also about the time that Homo sapiens ("anatomically modern" humans) emerged as a species distinct from other hominids such as Homo neanderthalensis and Homo erectus, which also existed at the time although were living in Europe and Asia, respectively. Wikepedia, for instance, quotes the emergence of "archaic" Homo sapiens as 250,000-400,000 years ago.
My thought is that, perhaps as Homo sapiens populations became more dense in Africa or perhaps because of some environmental change that reduced food availability, competition for food became fierce and the ability to procure enough food became a major factor in natural selection. It wasn't about quality at this point, it was about quantity; you didn't need to live a long and healthy life, you just needed to live long enough to sire a few children who survived.
This strikes me as the type of competitive environment where cooking shines. There are many plants that are not edible raw, such as grains, beans, etc. Cooking, because it destroys enzymes and proteins and because it can be done in a water bath that leaches out certain types of water soluble compounds, renders edible some plants that would otherwise be inedible. So those individuals who learned to cook their food would have an advantage because they could eat things that others could not, thereby expanding the available calories in their surrounding landscape. Animal foods can be made more safe and palatable by cooking, regardless of their age, and perhaps humans of the time endured a low enough general state of health that protection from parasites was useful. So overall, even though cooking makes foods less healthy and negatively impacts the human body in various ways, on net it was a beneficial innovation because it made more calories available.
If cooking emerged when Homo sapiens was still an African species, this would explain why cooking is so ubiquitous among cultures around the world. Our distant ancestors brought the technology of cooking with them when they left Africa. It also explains, perhaps, why Homo sapiens eventually outcompeted Homo neanderthalensis and Homo erectus. These species may not have cooked and thus depended on a narrow range of food species, while Homo sapiens, armed with cooking, could use a far wider array of species and was consistently better able to meet its caloric needs, expand its population, and outcompete other hominid species.
The ability to radically expand the types of foods we can eat through cooking led to calorie-rich grains becoming a more and more important part of our diet, which would eventually lead to us experimenting with and eventually becoming dependent on agriculture. We see this same relationship between cooking our food and our agricultural practices today, as much of the cropland throughout the world is devoted to crops that would be useless to us without cooking.
I'm sure there are other important factors, such as the addictive nature of certain compounds found in cooked foods or the psychological and social aspects now associated with cooking, but I suspect these were long to develop so I don't think they played a role in the development and spread of cooking.
[Note: while searching in vain for the article on when cooking emerged, I found an old post entitled "Why have we been cooking all this time?", in which Paleo Donk offers the same theory for the historical value of cooking although his wording is not as detailed. I came up with it independently, but still wanted to give him credit as he came up with it first.]