Instinct, in that Walker joined forces with Cruz, and Trump saw both of them as "hitting" Trump, so he "hit back." Trump hasn't figured out the finer points of manipulating the electorate.
He in the case could have done less.
He got it more out there hitting Walker by 1000% than Ted could have by announcing the endorsement.
Yeah, that wasn't smart.