God’s love is a complicated doctrine.
We began this series discussing some of the major problems people have in understanding God’s love—most notably a sentimental view of love and a general ignorance concerning God’s other attributes. But the most profound theological problem with God’s love is how it harmonizes with His other attributes—most notably His justice and wrath.
It is perilous to assume that God’s love gives us license to sin freely. God’s love must coexist with His sense of justice and righteous indignation at the wicked. For the careful student of Scripture, that coexistence presents perhaps the greatest tension in God’s Word. And God declared that tension concisely when He appeared to Moses on Mount Sinai:
The Lord, the Lord God, compassionate and gracious, slow to anger, and abounding in lovingkindness and truth; who keeps lovingkindness for thousands, who forgives iniquity, transgression and sin; yet He will by no means leave the guilty unpunished. (Exodus 34:6–7)
That may not be a famous passage of Scripture, but Mark Dever affirms its crucial importance in knowing the God of the Bible:
If we want to understand the God of the Bible, we’re going to have to understand this passage. This is the promise of hope for the redemption of God’s people. The biblical picture is not simply of an uncaring God of grim condemnation. God is not only holy and just in His unwavering commitment to oppose and punish sin; He is also faithful to His promises. Throughout history, God planned and promised to reveal His glory to His people. And He did. But how could the Lord forgive wickedness and yet, as He says here, “by no means leave the guilty unpunished”? What’s the answer to that mystery? 
Exodus 34:6–7 confirms that love is not God’s only attribute. Nor is it His alpha attribute. It cannot cancel out or overwhelm His justice and wrath. God’s lovingkindness must operate within the bounds of His holiness—He is unable to “leave the guilty unpunished.” John MacArthur explains why:
Justice is a legal term that describes the righteousness of divine government. God is a just God. His justice is as unchanging as any other aspect of His character. God cannot change His mind or lower His moral standards. Since He is utterly perfect, any change at all would diminish His perfection—and that would be unthinkable. So His justice is inflexible; His holy nature demands that it be so.
As Creator, He is entitled to rule over all His creatures any way He pleases. The Potter quite simply has power over the clay to fashion it any way He desires. He makes the laws; He determines the standards; and He judges accordingly. He created everything for His own pleasure; and He has every right to do so. He also has total power to determine the principles by which His creation must function. In short, He has the absolute right to do whatever He determines to do. And because He is righteous, He rules in perfect righteousness, always holding to the highest standard of truth and perfect virtue.
If any creature chafes under God’s rule or rebels against divine government, that creature then falls immediately under the judgment of God. Anyone who does not conform to the will of God incurs the inflexible justice of God. 
God cannot leave the guilty unpunished. That truth concerning God’s character—couched among all the comforting attributes that precede it in Exodus 34:6–7 (compassionate, gracious, slow to anger, abounding in lovingkindness, and forgives iniquity)—should not be lost on us. We must consider its sobering implications, because we are among the guilty:
There is none righteous, not even one; there is none who understands, there is none who seeks for God; all have turned aside, together they have become useless; there is none who does good, there is not even one. . . . for all have sinned and fall short of the glory of God. (Romans 3:10–12, 23)
Based on the testimony of Scripture, it would seem that God is unable to display His lovingkindness through forgiving sin because He must, by divine necessity, pour out His wrath on all who commit sin. Such tension is insurmountable to the human mind. But for God, the tension between His love and His justice is the perfect scenario to display His glory through the Person and work of Christ.
This is precisely where the glorious light of New Testament revelation shines most brightly, revealing the true depth of God’s love. He does not merely acquit sinners. He does not overlook their sin. In the Person of Jesus Christ, He made a once-for-all, infinite atonement for their sins. Now He covers them with His own perfect righteousness by imputing it to them through faith (Romans 4:11). All genuine believers therefore stand completely justified before a righteous God. It is not a future hope but a present reality. It is not a drawn-out process, but an immediate divine act that occurs at the first moment of faith. God’s holy wrath is appeased and His love is perfectly fulfilled in the salvation wrought by Christ. Thus, He Himself is truly the stronghold to which sinners may flee from His awful judgments. 
Jesus Christ’s sacrifice resolved the tension between God’s love for sinners and His just wrath against them. It met the exacting demands of God’s justice while demonstrating the depths of His great love. “So that he would be just and the justifier of the one who has faith in Jesus” (Romans 3:26).
God is a loving God. But that doesn’t mean He looks the other way when we sin. And it doesn’t mean we have license to sin without fear of any divine consequences. It does mean, however, that God is bound to His loving nature—so much so that He was willing to send Christ to suffer in our place under the wrath that we so justly deserve.
Source: The Tension in God’s Love