The GOPe fought Cruz until they had no choice but to back either Cruz or Trump. They see Trump is a disaster with his double-digit deficits to Hillary and record breaking unfavorability ratings and chose to back Cruz.
The GOPe doesn’t care if Hillary wins the presidency or not, but they ARE afraid of a really weak candidate pulling Congressional races down with him. That is what is driving them to support Cruz over Trump. They like neither, but they know Cruz is much more disciplined, less gaffe-prone, less likely to offend demographic groups, and more electable.