Exodus 23:1-9 is a great text on justice and mercy from the Old Testament, written after the Decalogue, that strikes a balance on how we are to view the poor (I’ve put the relevant verses in bold):
1 “Do not spread false reports. Do not help a guilty person by being a malicious witness.
2 “Do not follow the crowd in doing wrong. When you give testimony in a lawsuit, do not pervert justice by siding with the crowd, 3 and do not show favoritism to a poor person in a lawsuit.
4 “If you come across your enemy’s ox or donkey wandering off, be sure to return it. 5 If you see the donkey of someone who hates you fallen down under its load, do not leave it there; be sure you help them with it.
6 “Do not deny justice to your poor people in their lawsuits. 7 Have nothing to do with a false charge and do not put an innocent or honest person to death, for I will not acquit the guilty.
8 “Do not accept a bribe, for a bribe blinds those who see and twists the words of the innocent.
9 “Do not oppress a foreigner; you yourselves know how it feels to be foreigners, because you were foreigners in Egypt.
This well summarises what comes later in Leviticus 19:15: “Do not pervert justice; do not show partiality to the poor or favoritism to the great, but judge your neighbor fairly.”