Why did Ted Cruz let himself get tangled up on immigration?

If you read this as well as a bunch of posts by my colleagues, it is obvious that Cruz supported legalization (or at least led everyone to believe that he supported legalization). Given that, it seems Cruz could simply say that he changed his mind on legalization, or that he still supports legalization but only in the right circumstances, namely when his enforcement program has taken hold and reduced the illegal population. Instead he now insists he never supported legalization and never will. On Greta last night, he gave the impression of crab-walking up to Trump’s position–all illegal immigrants will be deported, end of story (although, of course, Trump says he will bring many of them back). I say crab-walking because if this was Cruz’s position earlier in the week, he simply could have said so at the debate. Cruz still wins the political argument on immigration with Rubio, but he has spent a couple of days on defense and made his own forthrightness on this an issue, when it was totally unnecessary. I believe that Cruz is disciplined and smart and basically doesn’t make mistakes–except to be too clever.