Gotham City is always portrayed so bleakly (at least during the post-Crisis era), that it's a wonder anyone lives there.
In the 1960s, we knew why people lived in Gotham City. It was always sunny with fair weather (except when Mr Freeze was in the neighborhood). The museums were brimming over with interesting exhibits of mammoths stuffed with postage stamps and priceless collections of Etruscan snoods. Despite a large population, the traffic was so great that even the Batmobile could roar unimpeded down the streets at its top speed of 40 mph. Unless, of course, there was giant cookbook or giant umbrella blocking the way at 5th & Cedar; but that's what detour signs are for, after all.
But in the 1970s, Gotham City became New York City. I mean, yeah, it always kind of was, but it was ... very different. It had seemed smaller, more colorful and contrasty, and cleaner. This was true even in the 1940s, when Gotham was clearly a dangerous place. But it wasn't just "NYC in the DCU". Heck, the giant props alone told you that.
However, when the Bronze Age started, it became important to editors/writers to distance Batman from his campy '60s image. One way they did this was to identity Gotham City very closely with New York City. If Gotham City was in a Bronze Age story, you can bet that a caption box mentions at least once that it was "a city of 8 million people" (or 10 million, depending on the year). Whoa, that's WAY bigger than Gotham City as I knew it! How the heck does Batman get around? Certainly not by swinging around rooftops, because Gotham City was suddenly characterized by hundred-storey skyscrapers everywhere. Those are very impractical for swinging around on, because you can't reach one building from the next (believe me, I've tried, which is how I got that scar on my forehead). That's a skyline like New York City... not like the Gotham City we knew, where all the action took place on the rooftops of medium sized office buildings, atop abandoned factories, and within construction sites.
Now, the "What Kids Don't Know" here is that in the 1970s, New York City had a pretty bad image problem. It was having a difficult time with budgets, crime, cleanliness, civic apathy; Manhattan in the 1970s wasn't exactly the Wonderland it is today. And the big burg's problems were magnified under the lens of popular culture. If you want to know the picture that most non-New Yorkers had of the Big Apple in the 1970s, rent "Escape from New York", "The Warriors", "Fame", "The Panic in Needle Park", or "Taxi Driver".
It was no coincidence that the "I love NYC" campaign was begun in the late '70s, by a city leadership desperate to polish up the town's image and improve tourism. And so they did, helped by an amazing turnaround for the city in the '80s and '90s. Times Square used to be "Crime Square"; but nowadays, even Anderson Cooper spends his New Year's Eve there.
Gotham City, however, went the other direction in the post-Crisis era. As New York City became brighter and shinier and more giant-propish, Gotham City became darker, grimy, and more squalorifferic. Writers indulged in an escalating arms race to portray Gotham as, well, crappier and crappier. The advent of *sigh* the ridiculous "Bludhaven" exacerbated this game of civic limbo, with each city trying to outdo the other in its irredeemability. Eventually, Bludhaven "won" by being wiped off the map by Chemo, which I chose to view as a very amusing meta-statement. The Silver Age pretty much told the Iron Age, "Okay, enough is enough, and we're going to have one of our most absurd characters put an end to this right now." Once again Silver Age inventive lunacy trumps Iron Age "gritty realism". But not before Gotham City had upped the ante by having not-one-but-two plagues, an earthquake, and a federal condemnation and cordoning. Because that's realism.
In the Geoff Johns era we know live in, where the DCU is shinier (except for the occasional decapitation-caused bloodspurt -- and even that is a lovely shade of red), a brighter Gotham City is long overdue. We can discuss that further and when we do, this may be food for thought...
Why Do People Live in Gotham City?
Economy. In short, the economy of Gotham City rocks. It practically oozes money. It must, because, unless you're a thug, you're probably a millionaire. You can't swing a Jokerfish in Gotham without hitting a millionaire square in the face. Its diversification is prodigous, it's an economic rainforest; you can get anything you want in Gotham City, and probably wholesale (including purple kangaroos). Ask yourself what kind of economy can fritter away money on working giant props atop every friggin' factory, and you'll see what I mean.
Real Estate. Have you noticed you no longer read that "city of 8-10 million line" in every Gotham story? Say what you want about the "No Man's Land" storyline, it certainly paved the way for a leaner, meaner Gotham City. But the city isn't physically any smaller so... there's lots of property. Property is cheap is the most economically powerful city in the DCU. Its a buyer's dream there. Everybody -- including desperadoes -- can afford a nice big apartment in a high rise (unless the story requires them to be an improverished orphan, who'll just wind up being swept up at some point into the largess of the Wayne Foundation anyway). And no matter how bizarre your hideout is, it doesn't attract attention because it's lost in the sea of realty. Abandoned warehouses, theaters, and factories, why you can practically buy them on Craig's List in Gotham City.
Culture. C'mon, this goes without saying. Metropolis, it has lots of science and Superman tschotskes, but that's it. Even Metropolis museums are all 'natural history' museums, existing only to house that one piece of kryptonite meteorite from Ethiopia they've all got. But Gotham City? It drips culture. There's a museum or a theater on every corner (as evidenced by the fact that, though one appears in every other story, it's never the same one twice). Famous writers, like Kaye Daye, live there; hipsters throng to Gotham Village; there's a charity ball every night of the season. It's a hub for theater, cinema, and performance art. Heck, I almost assume that that's why so many super-criminals live there: their bizarre appearances and shenigans are camouflaged by the prevailing weirdness.
Pedestrianism. Gotham City is designed as a pedestrian heaven. In Central City, people have to drive to their mailboxes; that's why you never see any people in the those giantic empty public squares where the Flash is always doing battle. But in Gotham City, people do not drive; they walk everywhere. Even if they are gadzillionaires coming home from the theater. The streets of Gotham are full of people, but empty of traffic. Which is why the Batmobile still never gets stuck in traffic. The only other people are the roads are armored car drivers and villains driving through the pouring rain on their way to kill all their former gangmembers.
Crime. Here's a statement that will crack the internet: Gotham City is comparatively free of crime. Before you freak out (particularly you youngsters raised on the idea that "Gotham is the Most Dangerous City on Earth-1"), think for a second. What kind of crime do we actually SEE in Gotham City? Murders, mostly. And it's mostly criminal-on-criminal violence. As long as you don't happen to get caught in the crossfire, or become the victim of some psychotic deformed villain, it won't affect you at all. Gotham City has crime of high "quality" not crime in high quantity. Street gangs, muggings, break-ins, home invasions, store hold-ups, etc. -- nearly non-existent. Why?
Because regular criminals are terrified to operate in Gotham City. You wanna rob a gas station where the Jokermobile might just happen to be gassing up? No. And eventually you're going to be "made an example of" by some supervillian or themed gangster, or get sucked into the thrall of goonhood where you'll be cannon fodder for some mastermind. There are no old criminals in Gotham City. For those of you who doubt this theory, remember that, to some degree, it's already in continuity. It's canon that Ye Old Crime Families were driven out of Gotham City by the costumed weirdos that followed in Batman's wake. Truly, Gotham City got the "better class of criminal" it deserved.
But if you're a regular person in Gotham City, you are statisically MUCH less likely to be a vicitm of crime than citizens elsewhere. Of course, if you do become a victim, you will suffer much more horribly (say, being eviscerated while alive or laughing yourself to death or being thrown into a vat of acid). But that's just part of Gotham's natural extremity... and charm!