There's more than local zoning at play. There are health regulations regarding potable water and sanitary waste disposal for dwellings that occur at the state level. There's ADA and FHA at the Federal Level.
Also at the local level are things like occupational taxes and building permits. Unlike room and whole house rental, a container provides direct visible evidence of the activity from the air, over a neighbor's fence, or sometimes from the street.