Is it ok to keep a secret like this?

I have this friend from my closest friend group, who used to like me and flirt even after he got engaged. Before knowing he had a girlfriend and planed to get married I flirted back, but after finding out I distanced myself. They got married and seem happy now. He would text in the beginning of their marriage and I would respond to only absolutely necessary, like regarding our mutual friends most of the time. After he noticed I set this boundary, he disappeared entirely, so much that when I wished him a polite happy birthday this year, he didn’t say thanks. Now his wife is a part of the group too and through girls’ night outs we realized we are sooo similar as people. She is literally one of the people that have that vibe that makes me feel at ease after we talk about anything. We shared problems and she has always given advice and support. Just to mention - she doesn’t know about any of this and I feel it’s not my place to tell or potentially ruin their marriage now after two years over something that wasn’t even a thing, except for the inappropriate flirting on his side. I went to have dinner with her today alone because she invited me as it was my bday a few weeks ago and she couldn’t attend. And I went. We had the most fun!

Now I am talking to my boyfriend about it, he thinks I am putting her husband in an awkward position and am being a fake friend with her by not telling her he liked me in the past. Do you think he’s right?