Was it
that long ago?
You're not the only one. Few people, including professional analysts, really expected Trump to win. It's pretty much unprecedented.
Also, keep in mind the establishment Republicans didn't (and still don't) want Trump. But, enough voters did, so they're stuck with him.
1) For years, the Republicans have catered primarily to the wealthy business class. They have a fanatical devotion to cutting taxes (for the rich), scaling back regulation, free trade, limited government. The reality is that even though many people self-identify as conservatives, they aren't rich; they don't want to eat tainted meat; they think free trade kills American jobs; they want government to do all sorts of things.
Some Republicans are social conservatives, and they've lost a lot of those battles for decades now.
The establishment Republican ideology is out of touch with the rank and file. The Tea Party was a warning sign about this, which they missed because they focused on assimilating and neutering that movement.
2) Trump appeals to certain groups: Nativists, xenophobes, racists, the shafted white working class. While not all Republicans are racists and xenophobes, lets face it: That's an undercurrent in many "Red" areas.
3) The other candidates
sucked. The sheer number of candidates is an indication of that; if a particularly strong candidate was running, that would have dissuaded half the field. We saw that with the Dems; Clinton was so heavily favored that numerous other possible candidates (like Booker) passed.
4) By the time Trump was becoming a serious contender, establishment Republicans were already freaking out, expecting a major loss, expecting to lose down-ballot votes. The convention mollified them a little bit, and they figured that maybe they could get Trump to pivot into a general election stance. They had no idea that Trump was basically a giant freaking troll, who has now publicly stated that he will continue to act just like he has all along, even if it means losing the election.