The ordinance passed by a 5-2 vote after local officials have wrestled with how to control crime at local hotels.