She could take down a guy whom Sam had trouble fighting. It’s kind of sad that she could have got an awesome fight with Dylan when she was instead chilling at his penthouse. And why didn’t he let her go anyway? There was no clear reason, she’d fulfilled her purpose: Sam finds Autobot information for the Decepticons or she dies. With them gone, there was no use keeping her around, let alone telling her the master plan.