Re: Possibly bugged epilogue outcome? (Spoilers)
I think it's an unexplained combination of your inquisition influence level, your judgement decisions, your approval levels with both, your decisions made during their side quests and also in the main story mode on the Templar vs Mage issue, and also whether or not you're actively romancing cassandra.
In my first playthrough (female mage normal mode, romancing Blackwall), I achieved full friendship with Cassandra, who would up becomming the next Divine.
In my second playthough (male mage nightmare mode, briefly bromancing Dorian then fully romancing Cassandra), Leliana became divine, and Cassandra chose to reform the Seekers. I'd wanted Cassandra to be divine, but somehow Leliana got chosen. Perhaps the romance precluded it.
As for me ... in the larger scheme of things, I think Cassandra is probably the much better choice than Leliana. Both are reformers yes, but Cassandra's motives and beliefs are more pure, and somewhat less controversial to the rank and file, whereas Leliana brings with her a lot of baggage courtesy of being your spymaster and master assassin. If leliana becomes divine it will definitely cause a rift in the chantry, and possibly even a civil war in the sequel. In other words, Cassandra has a better mix of reforms and palatability, whereas Leliana is too political, cold blooded, and controversial.
Personally, I'd have gone with Mother Giselle (IRL, often the best choice is the person who wants power the least), but we're not given that option, so my fallback top preference is Cassandra, hands down, without hesitation. 😉
In fact, I'm calling it now. In the upcoming sequel, if the player's gameplay results in leliana becomming divine, it will cause a civil war. Period. It might not be the main plot, but it will need to be a prominent subplot at the very least.