After years of political wrangling and lobbying by advocacy groups, New York state has legalized cannabis for adult recreational use in a move that’s expected to shake up the industry and inspire other states to move quickly to create their own programs.