I've often said that one of life's hardest lessons is that we can't change the past. Every decision we make has consequences, and if we do something wrong, we have to live with the results.
Yes, it was wrong in God's eyes for you and your husband to forsake your first marriage vows and cause so much heartache. Jesus' words concerning marriage are very clear: "Therefore what God has joined together, let man not separate" (Matthew 19:6).
No, you can't change the past but what you can change is the future, with God's help. What should you do? Begin by turning to Christ and asking Him to forgive all your sins. No matter what you have done, God still loves you, and Christ died for you. God's forgiveness isn't cheap; it cost Him the life of His dear Son. But now He offers it to us as a free gift, and all we have to do is receive it. The Bible says, "In him we have ... the forgiveness of sins, in accordance with the riches of God's grace" (Ephesians 1:7).
Then take steps to let those you hurt know you regret what you did to them, and ask for their forgiveness. The Bible says, "If it is possible, as much as it depends on you, live at peace with everyone" (Romans 12:18).