Real-estate agents and developers are attracting buyers who want communities involved in philanthropy.