"Besides, look how many of the companions from DA:O don't come back if you kill them. All the other ones."
You can kill Oghren in DA:O. He returns in Awakening with a lame excuse ("you left me for dead"—oh, yeah, sure. But my brother beheaded him once... all an illusion, it seems...).
Again, I don't see anything wrong with bringing back characters. Just, make sure you're not going to make them "killable", because really, it makes no sense for that character to be all alive and well if you killed it. And yeah, they explained Leliana in DA:I. But, they should have explained that in DA2.
I think that it doesn't matter how many people killed Leliana. The point is that they should have been done something to deal with that situation since they gave the option to kill her in the first place.
They should have been prepared for the eventuality that, given the option, people would kill her, intentionally or not (I know people that killed her accidentally, by bringing her to the defilement of the Ashes, even when they don't wanted to kill her; my brother for instance, though he just re-started from an earlier save point and changed the team... but, hey, is something that can happen).
That quote is from Trespasser's ending. It is not from DA:O. Meaning that is the sort of retcon they used to explain Leliana.
Leliana's problem in fact comes from DA2, were she shows up regardless if you killed her. I guess, all the complaining about that what was made them retcon things in DA:I
Yeah, that is the conundrum. Yet, we are talking about a plot device, that perhaps would never be fully explained.
To speculate, however, maybe some form of twisted Devotion. That spirit is devoted to what Leliana believed and represented.
My guess is that "resurrected" Leliana is in fact not resurrected, but a fade spirit that took her form and identity thanks to the super concentrated lyrium in the Ashes. Much like Cole and "Divine Justinia", but the lyrium somehow allows her to exists even in places where there is little Fade stuff (that Cole needed before the Breach).