You make it sound like they're tanking the election on purpose, but I don't think that's the case. I think the GOP's real problem is that their base has figured out that they're being used. For over thirty years big business has been using socially conservative white voters to keep themselves in office. Things have been quite nice for big business, as they've managed to keep their tax breaks mostly intact while minimizing new regulations, even in areas like banking and climate change. Even Obamacare was a pretty good deal for the pharma and health insurance industries.
If you're a socially conservative white voter, however, your world sucks. Gay marriage is legal. Immigrants are immigrating. Bathrooms have been thrown into chaos. Businesses have to serve gay couples and provide contraception to employees. "Progress" on anti-abortion has been minimal. A black man is president, and he fines you a little if you refuse to insure yourself. Your real wages haven't gone up for decades and you might not even have recovered from the Great Recession. And these social conservatives are starting to figure out that they've been had.
That's where the Tea Party started and why Trump is doing so well--the GOP base is pissed off. They're convinced that neither Big Business nor the Democrats represent their interests, because they don't, and so they have started voting to shut down and blow up Washington DC. And the one thing that Big Business could not come up with was a presidential candidate that TPers believed would deliver on social conservatism and blowing up DC. Bush was an insider. Walker was an insider. Kasich was an insider. Rubio was an insider. The top two GOP primary candidates were Cruz, who is publicly despised by everyone in DC, and Trump, who wasn't even taken seriously by anyone in DC until much too late.
What's going to be more interesting is what happens next election, assuming the country isn't a smoking ruin after a Trump administration. The fractures in the GOP are pretty deep at this point, so it will be interesting to see if it manages to coalesce back into something like its original form, or if an entirely new party somehow arises. Given what happened in the Democratic primary it's even conceivable that a viable party could form to the left of the Democrats.