You’ve answered your own question, cheating is, by definition wrong. If it weren’t you would had no reason, no need to forgive yourself. Given that you used your decision to cheat to help you do what was right, to leave your marriage and live a more authentic life, in the balance it worked out better than not cheating, probably for everyone. Hopefully you learned in the process that you can make that tough decision on its own basis, that you have the strength to do the right thing even if it’s hard, especially if it’s hard. Best of fortunes going forward;)