Even though I have a loving spouse, I get sad yet relieved knowing how different my life is now compared to when I was with my ex of 5 years.
Are there things about your ex that you miss?
I guess so, we had a pretty good time together and we had enough money to do whatever we were interested in
It's perfectly acceptable to think about past relationships from time to time, even if they didn't work out. As long as you do not obsess about your past ex and remain focused with your spouse, there isn't any issue with your behavior.
I accidentally started engaging in sexual activities with my ex. It feels good when I'm doing it but I feel depressed after.
While its good to reflect on your past, you've taken it a step too far. What you're doing is incredibly unfair to your current partner and it sounds like you should probably end your relationship. When your partner finds out they're going to be angry and probably end the relationship too.