Loki’s fake death in Thor: The Dark World was originally supposed to be permanent, according to his actor, Tom Hiddleston.
The 2013 movie had Thor (Chris Hemsworth) team up with Loki, his adoptive, villainous brother, to take on Malekith the Accursed (Christopher Eccleston). In the process, Loki winds up sacrificing himself, but (spoiler alert!) this is all a trick, and at the end of the movie is revealed to have replaced Odin (Anthony Hopkins) as ruler of Asgard.
“Loki’s death on Svartalfheim was written as a death, and I would say Chris and I played that scene for real,” he explained in an interview with Empire magazine. “That was meant to be that he redeemed himself, he helped save his brother, he helped save Jane Foster but that he, in the process, sacrificed himself.”
Hiddleston said that the “great twist” was devised when fans refused to believe that the trickster god was actually dead.
Thor: The Dark World is seen as one of the weaker entries in the Marvel Cinematic Universe; it underwent a number of reshoots, and director Alan Taylor describes it as having changed into a different movie in the process. He specifically mentioned that they added more of Loki into the film, because he found that her worked better in the story than he had initially realized.
Loki was long been considered the only really good MCU villain (though recent entries have given him some competition on that front); while a redemption arc against Malekith (generally seen as the weakest villain) would have been a good end to his character, most fans are probably pleased with the decision to keep him around, so that he could have more appearances in Thor: Ragnarok and Avengers: Infinity War.