Affordable housing opposition

Can someone explain why some NJ towns/municipalities are opposing the affordable housing law? Other than a prejudice against poorer people, what is their legal basis for opposition?