KJV Below (Link to NIV)
5 Hearken, my beloved brethren, Hath not God chosen the poor of this world rich in faith, and heirs of the kingdom which he hath promised to them that love him?
6 But ye have despised the poor. Do not rich men oppress you, and draw you before the judgment seats?
7 Do not they blaspheme that worthy name by the which ye are called?
The first verse is very likely referring back to the beatitudes of the Sermon on the Mount in Matthew, or, possibly, the relate “Sermon on the Plain” in Luke (where the poor are blessed and rich are cursed, with no mention of “in spirit”). There seems to be a particular issue here, though. It’s not just that they are rich, it’s that the rich people who are being honored are the ones who are attacking Christians. Suddenly the last verse of chapter 1 is brought into greater clarity (where is says to keep ourselves pure from the world). In the choice between demonstrating love to those who could never repay it and seeking the favor of those who are wealthy, but not only wealthy but actively working against Christ (and his love), many have failed. The compromise with the world has been absolute, and this is a problem.
Have you sometimes sided with the popular or rich people who were not acting from Christian love because you thought it would benefit you? Has it worked out in your favor in the long run? Why do you think the materially poor are called “rich in faith”?