There are old folktales about a village in England called Gotham, where the people are astonishingly foolish and do odd things. For instance, they had noticed that whenever the cuckoos left their nests and flew south, then the summer ended and winter began. So they built a fence around the woods where the cuckoos nested, to keep them in.
Washington Irving first called NYC "Gotham" in his humorous essays in the very early 19th century, and it caught on quickly.
George A. Thompson
Author of A Documentary History of "The African Theatre", Northwestern Univ. Pr., 1998.