I can understand your confusion; after all, the Bible tells us that Jesus was perfect and without sin. If anyone could enter heaven at death, surely it would have been Him! The Bible says Jesus was "tempted in every way, just as we are—yet was without sin" (Hebrews 4:15).
But listen: When Jesus died on the cross, all our sins were placed upon Him. In other words, although He was sinless in Himself, in God's eyes He became a "sinner"—because our sins were transferred to Him. Now He could no longer enter heaven—not until He had endured God's judgment on sin.
You see, we deserve to die for our sins—but Christ died in our place. We deserve to be judged for our sins and go to Hell because of them—but Christ took upon Himself our judgment and our Hell. The Bible says, "God made him who had no sin to be (or become) sin for us, so that in him we might become the righteousness of God" (2 Corinthians 5:21).
Do you want to know how much God loves you? Then look at Christ and what He did for you. He loves you so much that He was willing to take upon Himself the Hell you and I deserve. Have you responded to His love? If you have never done so, stop right now and thank God for His great love for you—a love so great that Christ was willing to undergo death and Hell for you.