This question on Worldbuilding used the phrase to describe banning vegetarians from eating meat:
Sure you can instute mandatory public meat eating, but that's like making a communist salute the flag. They'll eat the meatloaf to escape detection, but inside they're still deeply, morally corrupt.
I don't understand the meaning of this simile. Google searches for "soviet flag salute" or "chinese flag salute" show plenty of examples of communist countries instituting flag salutes, voluntary or otherwise, and I don't see how saluting a flag voluntarily would make one less morally corrupt.
While I inferred the meaning to be something along the lines of "making a bad person do something that a good person normally does", is this the actual meaning of this phrase?