Near future, the world is starved for energy. Nuclear, geothermal, renewables and biomass are used, but since oil and natural gas are exhausted they are not enough. Fresh water is exhausted and desalination requires a lot of energy. Many minerals are exhausted and recycling electronics without using acids requires a lot of energy. Land is exhausted and making deserts habitable requires a lot of energy. The cheapest remaining available source is organic matter. They begin by putting dead animals in greenhouses to desiccate them. The greenhouses are sealed to reduce oxygen and slow down decomposition. Then everything is mixed with wood chips and algae oil to improve combustion and burned in the classic biomatter plant.
They start by putting traps in all the sewers to catch mice, cockroaches and other insects. Then they begin to catch urban pigeons, crows and sea gulls, allegedly to cull them. But the demand for energy is still high and eventually they add dead people (people dead for old age or natural causes) to the mix. In some countries this is done secretly, they just give some ash to the families as if they were their ashes. In some countries they only burn people with no close relatives or people of poor families that cannot afford a funeral, but in some countries this is done openly. How can they justify the practice?
BTW even with dead people the initial step would be desiccation in sealed greenhouses, so the water content of the bodies should not be a hindrance.
Some users pointed that it would be more efficient to burn directly the food rather than the people, but that would require extreme measures, to make the food available, like forced sterilization, that would be way more controversial.
It could also be the case of a society on the verge of a collapse, like pointed by others, it is possible, anyway I see it as a scenario where people are scraping the bottom of the barrel, burning anything they see around. A view that actually was inspired by the increasing use of rubbish incinerators.