Its not what you think.
Beto was a very charismatic and attractive candidate. Cruz came across as stiff and wooden.
If the GOP had recruited another candidate, he would have won easily.
The GOP needs to do this across the board. A good example was John Culberson vs Lizzie Fletcher in Houston. Fletcher was a young attractive (though plump) young woman with a winning personality. Culberson was a fat gray-haired incumbent in his early 60s who has been in office since 2001. It was easy to portray him as one of those old GOP fat cat career politicians who is out of touch with his constituents (and the ads were NON-STOP).
There comes a time when some of these older guys who have been in office for nearly two decades need to step aside and let someone more electable succeed them rather than losing the seat to a 'rat.