Cruz, I think, is playing for 2020 either to primary the president or have a shot at the open seat.
Honestly I don’t think anyone really expected Cruz to support him. But as my son pointed out - the Melania speech would have been forgotten by the following morning, but here we are, days later, still seeing posts about it and hearing the pundits talk about it. Perhaps the appearance of Cruz wasn’t so much a mistake by Trump as a guarantee that a lot of people would watch. He is nothing if not a master showman!