Most of it wasnt done maliciously, but a city doesn't create square blocks, nice and uniform, on its own as it grows from a few hundred thousand to a few million inhabitants. If it grows organically, as in without a central plan driving it and pruning uncontrolled growth, you will get a very heterogeneous city layout.
[0] https://en.m.wikipedia.org/wiki/San_Juan_Hill,_Manhattan [1]The creative destruction of Manhattan, 1900-1940