He was only elected by a few votes when a judge ruled that Democrat Durham County could keep the polls open extra hours.
McCrory lost when he supported paying for the widening of I77 north of Charlotte with tolls administered by a foreign company. Enough votes switched in the highly populated counties along the highway to swing the election to Cooper. In addition the bathroom law, which McCrory supported, created a national furor, costing the state convention and tourism money and filling Coopers campaign coffers with out of state money and the streets with community organizers. The Democrats and media also successfully tied him to the coal ash environmental issues and his former employer (Duke Energy) dragging its feet with respect to the cleanup of the sites leaking poisons into waterways. Finally McCrory ran a typical lackluster moderate GOP defensive campaign against an aggressive and well funded Democrat candidate who adroitly capitalized on real and manufactured issues with support of the state and national media. The election was targeted by the Democrat party and social justice organizations seeking to shift NC blue. McCrory as well as the state and national GOP did not rise to the challenge.
You can bet well see a similar push by Democrats to defeat the lackluater first term GOP senator Thom Tillis in 2020 and pick up the seat of retiring GOP Senator Burr in 2022. If the GOP runs Bush establishment candidates, NC will be join Virginia as a blue state by 2022. Liberal whites are migrating into NC cities from other states in droves. The states legal and illegal immigrant population is also growing rapidly and the large black population can be counted on to vote solidly Democrat. Demographics is destiny.