We have to remember that "right" (meaning "correct"), "right" (meaning what one is "innately entitled to") and "righteousness" sound the same in English, but aren't exactly the same things, neither in Biblical terminology or moral theology. The same thing applies to what is considered "wrong" and "unrighteous" and "evil," which interestingly don't sound the same in English like the other words do.
The meaning of "righteous" in Biblical and moral theology basically means "justified," in the sense of two weights on opposite sides of a scale balancing out evenly between one another. It is a term that is applied to how God sees things, as whether something or someone meets an
established level of order regarding that subject's purpose.
However, what is "right" or correct may not necessarily agree with what is stated to be "just" or "righteous." For example, Jesus tells a Gentile woman who requests help that he shouldn't put serving her before the needs of his fellow Jews at Matthew 15:26:
" It is not right to take the children’s bread and throw it to the dogs."
The Canaanite woman replies:
"But even the dogs eat the crumbs that fall off their masters’ table."--vs 27.
In verse 28, Jesus grants the non-Jewish woman her request, but not because it is "justified" (according to what Jesus was sent out to do), but because it was the "right" or "correct" thing to do. That might seem contradictory because it is supposed to be. According to Christian theology there is a big difference between doing "justice" or "righteousness" (living up to the demands of the Mosaic Law, for example) and doing what is "just" or "right."
In the Bible, conforming to God's will is always "righteous" or "just." But this isn't always accomplished by means of following the letter of the Law or following a certain established rule of society or even logic. Remember how in Matthew chapter 3, John the Baptist doesn't want to baptize Christ. He already knows who Jesus is and it seems both illogical and not even correct to have a lesser one "baptize" a greater person.
"I need to be baptized by you, and yet you are coming to me?" Jesus said to him in reply, " Allow me to be baptized now. This is necessary to fulfill all righteousness ."--Matthew 3:14, 15.
It may not have made sense then, it may even have seemed contrary to the Jewish understanding of sacred things and holiness, but it fulfilled God's purpose, conformed to God's will which is often greater than what can be understood by a reading of the Law or limited by denominational and national boundaries.
So not everyone who believes in God has the same view of what is "right" and "righteous." The two are often linked, but not always the same. Someone in theory can do something which is against established rules, mores, and/or laws (what is "wrong" or "incorrect") but still be conforming to God's will. There are objectives that stay permanent, it is true, but according to theology God takes everything into account (what is relative) in ways that people still cannot comprehend. That is why people often make bad judges, especially when we claim to be doing so in the name of God, because we only have written objectives (the Bible) and not God's view of how the objective applies under certain situations or circumstances.
What is "evil" is also not the same as what may be "wrong" or "wicked." "Evil" generally means something which shouldn't be so but remains a constant, at least for a time. What is wicked or wrong usually describes a choice or action in relation to a set of objectives (like the Mosaic Law), but an evil can either be the result or something that even interferes and limits a "right" or "correct" action. We as people often do what is wrong, but we are not necessarily evil. We might even be at fault for creating a situation which could be described as an "evil," but that still doesn't change the characteristic of the person who caused the evil.
Of course there is a lot more about this in various religious schools of thought. I've just touched on some of the general Christian ideas.
It should be noted, however, that there is a significant difference in social views of justice and religious views. While there should not be a dichotomy between choosing what is evil over good in a religious sense, there is a dichotomy between the secular definitions due to the fact that more than religious people live in the world. For example, some may believe it is "right" to obey God, but it isn't "right" to force someone to do so or to accept another's view of who or what god to follow (if any). And just because a person doesn't believe in (and thus doesn't obey a) God, this doesn't mean the person fails to do what is "right" or just in either the secular or religious sense of the terms.
Even in Scripture we are told that humans will generally fail to judge persons accordingly and will be surprised to find out that the people they rejected or judged unworthy will turn out to be the ones who are the best examples of Jesus the world has ever seen.--Matthew 25:40-46.