Easy. He doesn't have to praise Trump. He could say, "As a Constitutionalist, I know what our Supreme Court will look like in four years if Hillary is elected, and our Constitution will continue to be ignored. Donald Trump has put forth a superb list of potential Supreme Court nominees. I call on all of my fellow Republicans to vote for our nominee...." Cruz doesn't have to say he likes Trump. He can just emphasize their areas of agreement.
I think that Cruz would have felt like a wimp endorsing Trump. I know that he wouldn’t do that. I think he should have just stayed away completely. He should not have done what he did.