The GOP didn't abandon Flake. He abandoned his constituents.

Jeff Flake’s political demise is Jeff Flake’s fault and no one else’s. It’s tempting to give some blame to John McCain as Flake became nothing more than Maverick’s “Mini-Me” during his one term in the Senate. But that was a choice he made. When Flake was first elected, McCain had been far past his expiration date with conservatives both nationally and at home. Flake was still a good conservative then, and willingly chose to mimic McCain.

McCain gets away with being as awful as he is because, like all senators who have been in Washington for too long, he’s spent several decades bringing home goodies to the money people in his state, like the Chamber of Commerce. Long-tenured senators survive most primary challenges because they are able to financially crush the upstarts.