After that her only function left was keeping Ketheric immortal, but for that she had to be removed from Shar's domain.
Except she wasn't. Shadowfell is Shar's domain (Shadowheart mentions this if you spare Aylin - That Shar is upset and you all need to GTFO before she intervenes. It's also where Shar takes Shadowheart from and tortures her before letting her leave)
Aylin was providing Ketheric with his immortality from within Shadowfell, when we find her it's inside Shadowfell.
The only complicated thing is how someone managed to get into Shadowfell and bind Aylin to Ketheric in the first place, as such a person would need to not only pass the trials, but also escape from Shadowfell after betraying Shar.
Which is weird because we see that it's not necessary for Aylin to be inside Shadowfell to be bound, as she's bound again near Ketheric during his fight at the end of the Mindflayer Colony. (Which also suggests that it's Ketheric himself that bound her). I suppose Ketheric simply decided that keeping her inside Shadowfell would make her less likely to be freed from his binding, given that someone would have to pass the trials to do so.