Religion rationalizes or make it easier to accept the fact that there is no such thing. We like to watch movies where the hero wins, but the world we live in often lets the bad guy take it all.
Some also try to rationalize this by saying that even if some evil doers are not held accountable by the justice system, they will still suffer. They will inevitably be tormented by their conscience, or experience the absence of true love from everyone that surround them. Take Stalin for instance, he did a lot of wrong, yet, never faced external consequences other than being feared rather than loved. Was he truly happy? The idea that he probably wasn't makes it seem like there is an ultimate justice after all.
But then again, I believe this also is trying to rationalize something we'd rather not accept. That perhaps these evil doers are happy nonetheless. We might simply be projecting on "evil" people. We could never imagine happiness by ruling over hell and so, we assume it is the same with people like Stalin. It's a comforting thought. Unfortunately, in spit of what good decent people think, perhaps these bad people don't hold the same values at all. As a result, they can still feel satisfied, fulfilled and happy in following their course. No consequences.
There is no real justice. The winner [good or bad] takes it all.