This is backwards. Hotels have always existed, but zoning restrictions on who or what could be a hotel came afterwards through law.

Most modern (20th century) regulations on topics like hotels were formalizations of existing socially accepted practices and often attempts to address obvious issues (eg many guests unable to escape a fire).