Corporate action or censorship?

I don’t know how legitimate these reports are, but there is something bizarre about the level of coordination and specificity of this multi-corporation attack on the Confederate flag. There are several reports that it was ordered by the U.S. federal government. The reason I’m a little dubious is: why would any corporation as powerful as Walmart, Amazon, or Apple obey such an obviously unlawful, unconstitutional directive instead of going straight to the media about it?