Jailing someone in the middle of a trial is a hugely disruptive delay. But now the trial is over, and the judge gets to count all ten counts of contempt (so far!) against Trump during sentencing. Trump has also been doing everything that a repentant defendant should not be doing, so even though it’s his first offense, he might get some actual jail time. Not the max, but maybe a few months. Especially if he violates the gag order and goes after the judge of his family again. Or the jurors.
It’s also a safeguard against the reigning power using bogus prosecutions against their opposition, like we see in many authoritarian states.