God generally works through our sins to bring us blessings, not as a reward for bad behavior, but to show us that He still loves us. The aforementioned mother out of wedlock is a good example; she’s been blessed with the life of a child to care for.
Of course God prefers to bless us in our good and holy deeds, but God is SO good and SO loving that God can make good out of bad. Even the murder of Christ is an example of this. God does not ask us to wish that Jesus was never crucified, but asks us to accept and embrace His sacrifice and see how much He really loves us. Our personal sins are the same way.
If God wanted us to live a different life, God would have made the Sacrament of Confession able to change history, as it’s well within His power to do so. We are sinners, and God has graced us with the ability to see how infinite His love for us is. It’s just another way He turns our evils to good. You are repentant if it hurts you that you hurt God, and intend not to do so again. God understands that you may make mistakes again, however, and that’s why you can ALWAYS go to Confession. It’s the regret of hurting God and the desire for the future that is important, not wanting to rewrite your past.