God is justice. He is perfectly just. He will never transgress a commandment. He will never excuse sin. He will never wink at a single violation. Nobody ever is let off, not one. He must be just. He will be just. All have gone astray. None are sinless. Everyone is cast out. Each must suffer the consequences of his own guilt. The law does not allow anyone to take it for you; you must pay the price. Nobody gets a pass -- ever -- not one single case. He will stand in judgment of all, and nobody escapes His all-seeing eye. Nothing anyone has done is secret, but all will be brought to light. We are doomed by Him, God, the greatest of all, the Creator of all things. He gave us agency, and then when we make bad choices, He must condemn us to incur the penalty of the broken law. God is perfectly just. “...Now the work of justice could not be destroyed; if so, God would cease to be God.” (Alma 42:13) There is no way out.
Over the millennia there have been many who have puzzled over how God could be both just and merciful. How can He forgive sins without robbing justice?
And now, the plan of mercy could not be brought about except an atonement should be made; therefore God himself atoneth for the sins of the world, to bring about the plan of mercy, to appease the demands of justice, that God might be a perfect, just God, and a merciful God also.
Alma 42:15
God made a perfect plan of justice that allows mercy. “For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.” (John 3:16) He sent His Son to save the world from the requirements of His laws. The Father is justice, Jesus is mercy. Jesus paid the price for all sin. He is the only One who did not sin, who did not transgress any law. He was the only One who remained innocent. Yet He suffered the pains of a damned soul... “—how sore you know not, how exquisite you know not, yea, how hard to bear you know not. For behold, I, God, have suffered these things for all...” (Doctrine and Covenants 19:15-16)
Justice is a scale that must balance. One side requires that the perpetrator of a crime pay the penalty of the law, the other is the recompense of an injured party. For justice to be complete, all parties must agree that the scales balance perfectly. The punishment for the criminal must fit the crime, and on the other hand, the judge cannot ask the injured party to simply forgive the perpetrator. That would make mercy rob justice. The injured party has a right to payment but may forgive the debt if he wants. The point is that each party is satisfied.
Jesus innocently suffered the pains of a damned soul. That is not just; it is the only debt ever incurred by perfect justice. Nobody else is sinless: “They are all gone aside, they are all together become filthy: there is none that doeth good, no, not one.” (Psalms 14:3) Only the Lord, Jesus Christ, was truly sinless. It is also essential to note that He did not bring suffering on Himself. He said in the Garden of Gethsemane, “...Father, if thou be willing, remove this cup from me: nevertheless not my will, but thine, be done.” (Luke 22:42) If you cause your own suffering, then you owe yourself justice. But in this case, the Father asked the Son to suffer, and He willingly obeyed, just as Abraham placed his promised son on the altar, and Isaac submitted. Because of this, the Father owes a debt to the Son. This is the other side of justice: an injured party has a right to just recompense. He is entitled to demand payment. God must be just, so Jesus can ask for recompense of the suffering He willingly bore at the request of the Father. But, what do you give to someone who has everything, who has created worlds and has all power? The answer is found in His love -- mercy. He asks for us to be forgiven. He pleads our cause before the Judge:
Listen to him who is the advocate with the Father, who is pleading your cause before him—Saying: Father, behold the sufferings and death of him who did no sin, in whom thou wast well pleased; behold the blood of thy Son which was shed, the blood of him whom thou gavest that thyself might be glorified; Wherefore, Father, spare these my brethren that believe on my name, that they may come unto me and have everlasting life.
Doctrine and Covenants 45:3-5
This, I believe, is the most relevant scripture in the entire canon, explaining how mercy does not rob justice (see Alma 42:25), and how the atonement works for man; the reconciliation of justice and mercy through love. Paradoxically, my Advocate does not actually say anything about me. He does not justify my iniquity. He does not even tell the Father that I have repented and that I am now ready to enter the Kingdom. "Pleading [my] cause" is Him pleading for Himself.
In a court of law, if I have murdered someone, and my lawyer comes before the judge and says, “I’m a great guy and I have suffered pain, so you should let this man go free,” that is not just. However, the pleading of Jesus is not merely that He’s innocent, but that He suffered innocently by the will of the Judge, and deserves recompense for His suffering. It’s only just. On his own, He will return to heaven a Hero, having kept all the commandments of the Father; but He would be the only One. He is pleading justice for Himself by allowing those who believe on His name to come with Him. He loves them, and wants them to be with Him in the kingdom of God. This is His payment for innocent suffering. God, the Father, being just, grants His petition. Isaiah explains how this balances the scales, to the Lord’s satisfaction:
He shall see of the travail of his soul, and shall be satisfied: by his knowledge shall my righteous servant justify many; for he shall bear their iniquities.
Isaiah 53:11
He is satisfied that all those who love Him will be with Him in heaven. Mercy for us is justice for Him. Justice allows Christ's recompense; Christ's love chooses you as that recompense, which is mercy.
The stated condition for allowing His brethren into the kingdom is that they “believe on His name.” Those who believe in Him repent of their sins. We receive His mercy on the condition of repentance. It makes sense why repentance is necessary. If you do not come to Christ and repent of your sins, then you are not worthy to enter into the kingdom, being unclean. Thus, the Son cannot recommend you to the Father. “Therefore, according to justice, the plan of redemption could not be brought about, only on conditions of repentance...” (Alma 42:13) Our repentance is to turn away from the things of the world, and turn to God, seeking Him. God loves each one of His children, and pleads with them to repent. And for those who refuse, heaven does not rejoice in their condemnation. God weeps over those who do not repent and must suffer for their own sins.
But behold, their sins shall be upon the heads of their fathers; Satan shall be their father, and misery shall be their doom; and the whole heavens shall weep over them, even all the workmanship of mine hands; wherefore should not the heavens weep, seeing these shall suffer?
Moses 7:37
He wants every soul to come with Him. His love knows no bounds. He has paid the price of redemption. He has prepared the way for all to be saved. He sent His only begotten Son into the world to pay the price of sin, allowing all to return to Him if they would repent. This is indeed “where justice, love, and mercy meet in harmony divine.” (How Great The Wisdom and the Love, Hymns 195, Eliza R. Snow)