It had absolutely nothing to do with freedom or rejection of totalitarianism.
He could have easily encouraged people to wear a mask and set an example by wearing one himself.
But you're right that it was about political value. Or at least perceived political value.