When reading the Old Testament it seems that God punishes bad behavior. But according to the Catholic Church (catechism?) are sins punished by God, for example, in purgatory is it more like a karma, that sins themselves cause 'punishments'?
In the RCC, Purgatory is only a place where people eventually destined for heaven go. It is a place of purification and not punishment, before heading into eventual bliss with the all pure God. Unrepentant sinners who do not accept the salvation of Christ are destined for Hell, and will receive punishment for their sins.
This is what I gleaned from the homily at Mass last weekend:
God does not want anyone in Hell
God does not want to condemn anyone.
Pope Francis - General Audience
It is out of respect for our freewill that God does not force us into communion with him.
We cannot be united with God unless we freely choose to love him. ccc 1033 To die in mortal sin without repenting and accepting God's merciful love means remaining separated from him for ever by our own free choice. ibid
Hell is eternal separation from God.
Hell is what we created for ourselves through our refusal to accept God's friendship
I can't find any source for this assertion, but I thought it was an interesting takeaway from the Mass. It's as if Hell is just the natural consequence of evil. God doesn't want for evil to happen, but He loves each of us too much to enslave us. God doesn't want anyone to go to Hell, but he loves us too much to force is to go to Heaven.
Call Fr. Tim at St. Patrick's in Janesville, WI if you have any questions.