If God created man, would he not be responsible for the defect? I mean, he is God after all and he did not create us perfect obviously.
He did create us perfectly. If you notice, after creation God called everything good. We were perfect until we rebelled with that very first act in the garden. Sin is a contagious condition. We all inherited it.
Maybe this is not a defect. Maybe we were created this way purposely. Maybe God intended for us to be this way to see how we could handle an imperfect life. Once created, we were given a set of rules to follow. Maybe Gods original plan was to see who could follow the rules and who couldn't. After all, if God did not intend to make us this way why does he forgiven then?
I don't think you're far off but it's more like God takes the bad and turns it into something good. We weren't created sinful but God knew ahead of time that we would sin. That's different. That's called omnicience. He knows all and as our creator he knows full well what we're made of. Once created they only were given one rule that we know of. Don't eat of "that" tree.
God forgives us because we sinned. If we didn't there would be no need for forgiveness. Sin is basically rebellion against God. That's it.