Only Jesus was perfect, and that's why He could pay the price of our sins and take our punishment and God could forgive us. Jesus fulfilled the Law and its requirement of death to the sinners. He died in our place so that we wouldn't have to die! He voluntarily gave Himself to be crucified, He loves us so!
Jesus died of a broken heart!--What broke His heart was not our sins. He knew that we were going to be saved and be forgiven. What broke His heart was thinking that God could turn His back on Him. And at that time, feeling like the lost sinner, He went through an experience which, thank God, WE will never have to go through: Not just crucifixion, not just the agony of the body, but the agony of mind and heart and spirit, feeling that God had actually deserted Him! "My God, My God!" He cried out, "why hast Thou forsaken Me?" (Mat.27:46) Had God forsaken Him?--Yes, momentarily, that He might die the death of a sinner, without God!
Jesus loved us enough to give His Own life for us and take the punishment of our sins upon Himself on that cross, so that we could be forgiven and be saved! Such love! (Rom.5:8; 1Jn.4:10)