First, Robinhood does not make the market or fulfill the orders, so if their market-maker has no one selling a stock they have little option other than stopping people from making purchase orders. You need both sides for a liquid market.
Second, IF these are margin positions then it is not only allowed and legal but also typical for the broker lending on margin to close out the position unilaterally. IF these are cash positions it is a completely different story.