Did I do the right thing?

I’m 17, I’ve always had a thing for older guys around 20-24 I understand that is really bad but I never had sex with someone older then me, I was seeing this guy who was 22 and we hit it off I kinda liked him but then I get a text from his friend ( who’s tried to flirt with me ) saying to text tyrell ( the guy I’m speaking to ) which never ends good, turns out he’s engaged with a baby on the way, I’m not a homewrecker & I doubt he wanted something real so I cut things off, I told him to respect her and if he’s committed to her dont be talking to other girls , I told him to respect her and if he wasn’t ready he shouldn’t have committed to her , I feel bad for her. Did I do the right thing? I just feel guilty I’m not hurt I’m just mad that he could do that to his pregnant fiancé with a 17 year old..