score:4
If someone who works for a hotel knows, I'll yield. But I'd guess that it's because they know from experience that people under 21 are more likely to have wild parties that annoy other guests, or trash the room, or fail to pay, or generally are difficult customers.
In the US. businesses are generally free to decide who they want to do business with, as long as they don't discriminate on the basis of certain reasons where it's specifically forbidden by law, like they can't refuse to do business with people based on race or sex.
I suppose from the way that rule is worded, "21 or accompanied by a legal guardian", if a married couple came to the hotel and, say, the wife is 23 and the husband is 20, they'd allow the wife to stay but not the husband. A wife is not her husband's "legal guardian". (Despite the fact that my wife often said that I was a child who needed her to take care of me.) I suspect in such a case the hotel would simply ignore the rule, but I'd certainly check before booking a reservation in such a case.