Why do cities with rich areas still contain poor areas?
Regarding NYC, it has mostly to do with public housing and rent stabilization. 

Here's a map of public housing in NYC. Notice the large public housing developments in lower Manhattan, The Bronx, and Bushwick.

About half of all apartments in NYC are rent stabilized, and these apartments tend to be priced at a fraction of the market value and inhabited by tenants who never move (because then they'd lose their precious deals). Thus rents in NYC have a bimodal distribution.