In Psalm 72, David made a specific request that God would give him love of justice.
1 Give your love of justice to the king, O God,
and righteousness to the king’s son.
2 Help him judge your people in the right way;
let the poor always be treated fairly.
3 May the mountains yield prosperity for all,
and may the hills be fruitful.
4 Help him to defend the poor,
to rescue the children of the needy,
and to crush their oppressors.
For the remainder of the Psalm he spoke of how that would impact his actions as king. He consistently mentioned the poor and the oppressed – with a clear desire to crush the oppressors.
A little later in the Psalm, he again revealed his commitment to the poor.
12 He will rescue the poor when they cry to him;
he will help the oppressed, who have no one to defend them.
13 He feels pity for the weak and the needy,
and he will rescue them.
14 He will redeem them from oppression and violence,
for their lives are precious to him.
He clearly had a heart for those who were suffering, and used words like rescue and redeem repeatedly to talk about how a king should care for those under his care. This reminds me of God’s love and justice, reinforcing the notion that David was a “man after God’s own heart.”