JUSTICE AND RELIGION
We get a clear picture of how God sees justice and righteousness compared to religion in Amos 5 which is summarized in Amos 5:14-25:

14 Seek good, not evil, that you may live. Then the LORD God Almighty will be with you, just as you say he is. 15 Hate evil, love good; maintain justice in the courts. Perhaps the LORD God Almighty will have mercy on the remnant of Joseph.
COMMENTARY: These verses anticipate the contrasts between verses 14 and 15 with good being justice and righteousness and evil being religion. Essentially, God says to hate religion and love justice.
The good and evil contrasts are symbolic references to the Old/First Covenant and the New Covenant.
16 Therefore this is what the Lord, the LORD God Almighty, says: “There will be wailing in all the streets and cries of anguish in every public square. The farmers will be summoned to weep and the mourners to wail. 17 There will be wailing in all the vineyards, for I will pass through your midst,” says the LORD. 18 Woe to you who long for the day of the LORD! Why do you long for the day of the LORD? That day will be darkness, not light. 19 It will be as though a man fled from a lion only to meet a bear, as though he entered his house and rested his hand on the wall only to have a snake bite him. 20 Will not the day of the LORD be darkness, not light— pitch-dark, without a ray of brightness?
COMMENTARY: These verses anticipate what it will be like for Old/First Covenant religionists when God destroys their religion in favor of the New Covenant. Their wailing is grief over the loss of their religion and those special days (i.e. day of the Lord) when they traditionally gathered together for their religious activities.
Once the New Covenant is established, they will see that the religion that they thought was light was actually darkness.
21 “I hate, I despise your religious festivals; your assemblies are a stench to me. 22 Even though you bring me burnt offerings and grain offerings, I will not accept them. Though you bring choice fellowship offerings, I will have no regard for them. 23 Away with the noise of your songs! I will not listen to the music of your harps. 24 But let justice roll on like a river, righteousness like a never-failing stream! 25 “Did you bring me sacrifices and offerings forty years in the wilderness, people of Israel?

COMMENTARY: Festivals, solemn assemblies, offerings, songs, and music are all basic features of religion. God does not accept these activities nor does he take delight in them because they are all examples of religious traditions of people whose hearts are far from God.

Verse 24 establishes justice and righteousness as God’s desired alternative to religion.

Verse 25 indicates that while in the wilderness, Israel understood the symbolic meanings of sacrifices and offerings. It was later, after entering the Promised Land, that Israel reinterpreted the literal scriptures as religious activities identical to the religious activity of the pagan, Canaanite religions from whom they learned how to worship in the flesh with festivals, solemn assemblies, offerings, songs, and music.

These scriptures are a paraphrase of the entire Bible which is about the transition from Old/First Covenant religion to New Covenant worship in spirit and truth. It is a transition that does not come easily or quickly but comes with much conflict as between enemies where the kingdom of the one true God overcomes all other religious kingdoms of all other false gods.