The fire codes and taxes for a hotel are much more onerous than for a residential apartment building. Presumably landlords who are doing illegal conversions are flouting both, plus also violating zoning rules by converting a residential building into something else. (I believe NY zoning has specific "hotel districts".)
I think it has a lot to do with residential rental inventory as well. Rent control. There is such limited available apartment rental inventory that to take units off the market, carve them up and sell them as hotel stays completely skews the real estate market and drives up the rent. If every landlord did that no one would have a place to live
I kind of find myself being more sympathetic to landlords in this case. Yes, if everyone did that there wouldn't be any space to live, but looking for short-term subleasers is also a lot more risky. They need to be found, first of all - you're competing with every other of their residence choices - and after that, they have a greater risk of damaging your property. But if after this pro/con analysis, it is economically better for you to do short-term leasing - I think you should be able to.
Also hotel safety laws do not exist in a vacuum. AirBnb renters should be properly informed that the building they are entering has passed building inspection codes, but cannot guarantee hotel-level hygiene and fire code safety. Once fully informed, if the renter still chooses AirBnb, it's their call. People can sleep over at their friends' houses, or at strangers' houses without exchange of money anyway - the fact that money does change hands doesn't change the facts about the parties involved.
Disclosure only works when the customer has a real ability to assess the risk they're accepting. Most folks aren't even aware of the fire codes for hotels versus residences, or why they exist. (In particular, the extra danger in fleeing a fire in an unfamiliar building.) Once you have money changing hands, it's a business, and isn't comparable to having houseguests over for the night - the motives are profit-based.