First, it would seem that Ted Cruz was being willfully dishonest in his efforts in that while on the one hand he was supporting the bill while offering the poison pill he was hoping to kill the bill. That seems like one explanation.
Second, Rand Paul (either truthfully or just because he's campaigning) disputes Ted's story.
From today's Washington Post
Cruz's Record On Immigration Can't Be Redeemed By Sen. Jeff Sessions
Rand Paul knows what he is saying is not true. He’s just mad at Ted for stealing his mantle, and the having his dad pick Ted Cruz over him.