Let's be clear, a judge just sprung a traitor explicitly to punish the President for speaking out on the case.
No, it has nothing to do with punishing Trump. It's about fairness to the defendant. The argument was that he could not receive a fair sentence after the President's statement, and the judge agreed felt he was legally obligated to consider it as a mitigating factor in the defendant's favor. Now you may not like that line of reasoning, but it wasn't done to punish Trump.
We also don't even know if that actually affected the sentence or whether or not he received jail time.