Apartment buildings may have different codes depending on their height (you can't build a 10 story wooden building for instance), there's codes which regulate exits, access, max occupancy, etc... Single family homes have different code to follow because the expectation is that only 1 family will be living in it, versus an office tower or hotel with thousands...
A relevant example - not every basement is suitable as a living suite, but many are rented out anyway, which is against the law (there are certain codes which much be followed to ensure a rental suite is legal). This would apply to AirBnB as well. Traditional bed and breakfast places have rules to follow as well, business regulations, building code, etc...
Since you mention it, I suspect that an "official" hotel room has to be built and maintained to a much higher standard than someone's house or apartment. Width of exits, sprinkler systems, etc.
As an interesting counterpoint here, it's legal to let someone crash on your couch, but the second you ask a dollar from them for the space, everything changes. That doesn't necessarily make sense to me.
People that do AirBNB in NYC aren't doing it at the same recurrence rate as 'having someone crash on the couch.' Either AirBNB hosts are trying to control the tone on hackernews or people are seriously oblivious to reality.
The person who paid you to sleep on your couch is just some person with cash. Especially if you are not around, they're much less likely to feel socially obligated to treat the place like their own.
[1] http://thevillager.com/villager_199/astouristfillillegal.htm...
There's much more money in the tech industry.
It's about protecting consumers...