I've stayed in hotels that were frequented by prostitutes (not a value judgement, but it does change the experience of the stay considerably), hotels with drug dealers in the parking lot, etc. Even going with a big brand, I've had extremely disappointing experiences.
Most recently, I stayed at the Hyatt Regency in Louisville, which is a highrise hotel in which all the rooms are located around a central lobby. This is fine, assuming there aren't people screaming in the lobby, but surprise, there were literally people screaming in the lobby for long periods in each of the two nights we stayed there, and repeated calls to the front desk didn't resolve the situation.
We'd planned a longer stay, but ended up relocating after the second night of interrupted sleep, and somewhat ironically, ended up in a super quaint AirBNB that was a fraction of the price.
Yes, AirBNB can be a bit of a crapshoot, but that isn't a problem that's unique to AirBNB.
You have hotels either way and you clearly can't save the market for not-hotel rooms by prohibiting it entirely. Where is the harm in allowing someone to knowingly take a risk in exchange for a discount?
Not necessarily: https://en.wikipedia.org/wiki/The_Market_for_Lemons