So here it is, my spoilerish ramble for how to actually fit her into the storyline in a way that makes her more than a cute accessory. This doesn't happen, of course, but understanding it requires having played so it's still a spoiler.
When you return to Denerim with Arl Eamon and Loghain shows up to glower at you, if Leliana is in the party (at all, not just the adventuring party) Loghain arrives with a troop of guards, and declares that the entire party is obviously a pawn of the Orlesians - after all, a known Orlesian spy is right there! And Loghain has proof that she is on assignment. He has come to arrest her, and mockingly asks whether or not the "heroic" Grey Warden knew what she was up to. Player options are complete shock, asking Leliana if this is true (If you're not in a romance, she'll just deny it. If you are, she'll be upset that you would even ask her that.) or declaring that you suspected her all along (approval loss whether romanced or not).
As Loghain has what appears to be legitimate proof of Leliana's treachery, Arl Eamon turns on her and insists you hand her over, to show that he's not an Orlesian sympathsier. Leliana is dragged away, with Loghain hinting that he intends to torture her for information to use against you. This sets up a mission for you to either rescue her or silence her permanently.
When you find her, you can kill her, set her free and tell her to run, or bring her back to the party. (You may need to use some persuasion to get her to forgive you for letting her be captured in the first place, particularly if you acted like you distrusted her. A hardened Leliana will understand if you claim the need to dissemble.) If you tell her to flee the city, she'll point out that it must have been Marjolaine who gave Loghain her identity and the false proof of her current assignment, and you may be able to use this against him. Then she'll leave and you'll never see her again. If you bring her back to the party, Loghain will bring her up at the Landsmeet and it will count strongly against you.
Makes perfect sense within the story and provides for some meaningful decisions.
... Really, I thought it was odd that he talked about the Orlesians in his ingame speech and never mentioned that you had one of their spies with you. :)