Short squeezes are absolutely not illegal - They're a natural property of how the investment vehicle operates when the price of shares spikes.
The illegal part is a scheme to collude and manipulate the availability or price of the stock to intentionally cause a short squeeze. I'm not entirely sure I agree with you that posts like that are "collusion" (Cornell def here is interesting as a refresher - https://www.law.cornell.edu/wex/collusion), but I can certainly concede there's plenty of shades of gray here.
Robinhood would have legal liability for aiding and abetting an illegal short squeeze had they continued.