5 Listen, my dear brothers: Has not God chosen those who are poor in the eyes of the world to be rich in faith and to inherit the kingdom he promised those who love him? 6 But you have insulted the poor. Is it not the rich who are exploiting you? Are they not the ones who are dragging you into court? 7 Are they not the ones who are slandering the noble name of him to whom you belong?
James is speaking in generalizations regarding the rich and the poor in the same way that Jesus said that it was harder for a camel to go through the eye of a needle than for a rich man to enter into the kingdom of heaven. (Matthew 19:24)
The idea is not that poor people are saved by virtue of being poor or that the rich are excluded on the same basis. Instead the reality is that the poor are more likely to come to faith in Christ because they more readily acknowledge their need for a Savior. On the other hand, the rich tend to believe that they have achieved what they have on their own and are unwilling to admit what they consider a weakness in expressing the need for salvation.
James spoke to a specific time and situation with regard to the rich and poor but many things have not changed in all of the intervening years. There are certainly instances of the rich exploiting the common man today. Likewise there are plenty of rich and powerful people who blaspheme the name of God today. This does not mean that the poor are exempt from wrong doing back then or today. The point that James is making in this section is that the church was showing favoritism to the rich when they had no good reason to. If anything, the rich were against the church while the poor were the ones who were coming to faith more often than not.