Because it is contrary to the word of God! James 2:8-11: “Yes indeed, it is good when you obey the royal law as found in the Scriptures: “Love your neighbor as yourself.” But if you favor some people over others, you are committing a sin. You are guilty of breaking the law. For the person who keeps all of the laws except one is as guilty as a person who has broken all of God’s laws. For the same God who said, “You must not commit adultery,” also said, “You must not murder.” So if you murder someone but do not commit adultery, you have still broken the law.”
James is teaching us that we are to not show favoritism because to do so is to commit sin, to transgress God’s will and break God’s word. Those who show favoritism are guilty of violating principle after principle from God’s word.
Some think that in James 2:8-9, James is answering a defense the guilty may have made. “Our reason for treating the rich so kindly,” the guilty might have said, “is because God’s word has told us to love our neighbor as ourselves—and surely the rich would be included in that command.”
James answers by saying that when you treat the rich differently than you treat the poor, you are not obeying the command to love your neighbor as yourself; you are, in fact, committing a great sin in the sight of God, a point James does not want us to miss!
Any time an individual deliberately and flagrantly disobeys a command of God when he knows and understands what that command is, he shows that he has the basic disposition of heart to disobey all of God’s commands if it suits him. Thus the deliberate breaker of one of God’s laws is in heart “guilty” of breaking “all.”
Here is the point James is making: The sin of showing partiality is no insignificant sin. One cannot say, “So what if my heart is filled with prejudice? I am not a murderer or an adulterer; therefore, I am really a fine person.” James says that when you show respect of persons, you have disobeyed God, you have become a lawbreaker, and you have become “guilty of all.”