Being loving does not mean that others can't be punished. A parent who loves his child with an incredible depth will discipline his child when needed. In fact, to not discipline the child when it is needed would not be loving at all as that would be an encouragement to the child to rebel and do wrong.
God is not only love. God is also just, holy, and righteous. He must punish the sinner who has broken His law and who has refused to receive the atoning sacrifice by which the sinner can escape God's righteous judgment.
It is not a contradiction to say that God both loves us and punishes us. Both are within the divine character of God's greatness, and though we may not understand or even appreciate how God can love so greatly and also punish so permanently, we must accept the fact that God, who is the righteous judge, loves us (by dying for us on the cross) and judges us when we refuse to receive His love and sacrifice.