Cruz was not defeated. He was betrayed by the Republican Party.
One of the things I noticed that when I saw Cruz on TV he was constantly challenged with attacks from all sides. Personal attacks. He never bought into that, and simply went back to pointing out the damage that Obamacare is already causing to the economy.