Have you really had that experience in NYC? I've lived in Brooklyn for 10 years and have only once had a cab refuse to drive me home.
It got to the point I was getting turned down more than accepted for rides from Manhattan to Brooklyn so now I just use ride share by default.
(For reference, I'm white so it's not a problem of being a minority. I do live pretty deep in Brooklyn in a "bad" neighborhood though - maybe getting a ride to Williamsburg etc is easier)