The practice of penalizing taverns for serving gay patrons, who at the time were mainly men, was widespread across the country during the early to mid-20th century, when gay sex was itself a crime, said George Chauncey, a history professor at Columbia University and the author of “Gay New York.”