During the course of the movie, Heather Lee decides to help Bourne at critical times for reasons that are never made clear. Is she wary of the way that her CIA boss is running things? Is she angling for a position of power herself? Why does Lee want Dewey gone?
I think it's a case of her seeing an opportunity to get rid of him, thus creating a power vacuum that she can fill. Dewey says to her quite early on something like "don't let your personal ambition get in the way" and a couple of times we see her going over his head to suggest something to the Director of National Intelligence, so she's obviously very ambitious and keen to move up the ladder, as it were. Couple this with the fact she obviously doesn't like Dewey's methods (and I guess has some insight into how Bourne has been treated by Dewey and his predecessors), she thinks she has a better way of doing things and seizes the opportunity.
Heather Lee is the head of the Cyber Ops division, and believes that Dewey's methods are outdated. Simply put, it's cyber warfare and Dewey isn't fit to lead the CIA.
She is given the task of bringing Bourne back into the CIA, however, as we see, she failed to do so. Dewey attempts to have her and Kalloor (head of Deep Dream) killed because she was aiding Bourne (to gain his trust), and Kalloor was going to reveal who funded Deep Dream.
So Dewey had already discovered her ulterior motive of replacing him?
Like the other comment stated, she was ambitious, and he wanted to make her look bad, this is why he sent the asset to kill her team.
All of the above feels very credible about Heather's planned detente with Bourne and coup d'etat with Dewey, however Bourne kept his eye on her and although she gained her coveted position she will unlikely get him to come in. I think however, he will string her along and use her for various intel.To his advantage, she will probably do anything to keep a line of communication open with him. I know he trusted Nicky and I think he trusted Angela Landry but I doubt Heather can fill their shoes.