IANAL but I suspect it is actually legal for Amazon to short CVS+Walgreen in this case: Don't "inside information" trading laws apply only to the specific company about which information is available?
Doesn't the person on the other end of the short sue Amazon for having insider information material to the value of CVS+Walgreens? Or if not "insider trading", then "market manipulation"?
Insider information is not well defined, but I don't believe that it covers this case (then again, IANAL).
"Market manipulation" is dissemination of false information or demand with the express permission of profiting. But there was no false information or demand here.