Knocking off Flake would be intensely satisfying for Trump even if it did weaken Republicans’ chances of holding on to that seat. Given the way the incumbent math is weighted so heavily in favor of the GOP in 2018, he may not even think Flake’s seat is that important in terms of retaining a majority.
But if the Democrats win the House next year — which is far more likely than is their retaking the upper body or even creating a 50–50 split there — Trump may rue the day he couldn’t resist the temptation to purge Flake. A Democratic House will almost certainly vote to impeach Trump no matter what the Mueller investigation finds about collusion with Russia. Absent proof of wrongdoing that goes beyond Trump’s egregious behavior and statements, persuading two-thirds of the Senate to vote for conviction and removal from office will be difficult. But in order to ensure that the Democrats don’t get anywhere close to it, the White House needs both a GOP majority and for the entire Republican caucus, not just Trump loyalists, to stick with him. That ought to persuade Trump to live with Flake’s criticisms.