Do you think it's wrong to go through your S/O phone if it proved your suspicions were correct?

In my last relationship I was very insercure and had a feeling he was cheating on me. I went through his phone and found out he was talking two 3 different girls (one being a very close friend of mine. He'd tell them he thinks about them all the time, how beautiful they are, how he can't wait to see them, ask for selfies, etc. I know it's an invansion of privacy and it's not something I would do again but I guess my question is do you think it puts YOU in the wrong if you find out he has been cheating? I'm glad I went through it and realized I was wasting years of my life with someone who didn't appreciate me.