Because he had excitement and enthusiasm behind him, as well as negatives below 50%, along with millennials turning out in great numbers almost exclusively for him. Many times a small, enthusiastic, group TRUMPS a larger, less enthusiastic one (see what I did there?)
After all, exactly what parts of the traditional Republican platform does Trump represent? It's a weird year, weird things happen.
Also, doesn't matter what I think. There is proof that the DNC was in the tank for Hillary. We'll never know what would have happened had they not been, or what other candidates never got in because they saw the writing on the wall.