At the beginning of the series, DS9 is in the middle of nowhere, Bajor's government and economy is on the verge of collapse, and all the civilians are moving off the station. They're about to be left with no services of any kind.
Sisko convinces (blackmails) Quark to stay, and his bar becomes the focal point for entertainment on the station. With a place to spend their leisure time, the Starfleet and Militia personnel will have better morale, traders will be more likely to stop at the station, and civilians will be more likely to live there and open up other shops, continuing to make the station a nicer place to live.
They don't like all the shady stuff he does, but Quark does play a big part in keeping the station running.