That does not necessarily mean that he is supporting legalization. He is merely pointing out that the one thing needs to happen before any discussion of the other should occur.
I don't find this sort of verbiage unusually for a Lawyer or a Negotiator. When you are trying to reason with the moderates in your own party, you let them think they might in the future get their way, if they let you get your way right now. You get them to agree on one point, and then you try to push them a little farther later.
It's what a clever fellow would do. I'm sure Trump has mentioned this tactic in his book "The art of the deal."
Cruz didn’t send this tweet to people he was negotiating with. He sent it to his most devoted followers. If he wasn’t serious about legalization, he wasn’t serious about security either; they’re given equal mention in his comment.