Although they're nothing exciting to look at, Planaria are remarkable creatures in at least one regard: when cut in half, they're able to regenerate two complete animals. The tail half will regrow a replacement head, while the head will extend a new tail (you can also cut them in half along their main body axis and each side will grow a new mirror image of itself).
Although this would seem to provide a huge evolutionary advantage—the animal can bounce back after being partly eaten—a number of related species lack this ability. Some have it in a more limited form, where they can regrow a tail but not a head. Now, scientists have used these other species to start to understand what happens when an organism regenerates missing body parts.
Initially, all regeneration goes through a similar process, whether it's the formation of a new limb by amphibians or a new head by a planarian. Once the wound heals over, a group of cells called a "blastema" forms at its surface. These are unspecialized stem cells that divide and grow and gradually spin off all the specialized cells (muscles, nerves) that need to be replaced. As the regeneration is completed, the blastema slowly dissipates, leaving behind replacement tissues.
In a series of papers that track the limited regeneration found in some species of planarians, the authors first confirmed that all of the initial steps of wound-healing and blastema formation occur normally in these animals. So if there's a problem with remaking a head, it happens a bit later in the process.
The authors of the different papers took different methods to get there (ranging from high-throughput DNA sequencing to making some educated guesses), but all of them came to the same conclusion: when regeneration doesn't happen, it's because the blastema isn't getting the right signals to tell it what kind of tissue it needs to form. There's one signal (Wnt/ß-catenin) that tells the cells that they should form a new tail and another (tyrosine kinase signaling) that indicates a new head is needed. One of the papers notes that this finding supports a model proposed over a century ago by geneticist and Nobel Prize winner Thomas Hunt Morgan, who suggested planarians relied on a combination of "head stuff" and "tail stuff" to regrow the right tissues.
A lack of regeneration can occur from some combination of not seeing enough of the right signal or seeing too much of the wrong one. In some cases, researchers were able to manipulate the signaling networks in order to override the normal behavior. For example, a head could be made to regenerate a second head, facing in the opposite direction, provided the right molecular tools were used—and this in a species that didn't normally regenerate heads at all. Animals with two tails were also created.
None of this gets in to why the organisms in question don't regenerate their heads in the first place. But it can help us to start answering the question. The signaling networks identified here are involved in a lot of important biological processes, and activating them could easily have unintended consequences. Now that we know what they are, we can start looking at what those consequences might be and how the planarians that can regenerate avoid these consequences.