Was the guy friend gay by chance? My boyfriend who has always identified as straight has a friend who is gay and is not shy about expressing his “fondness” for my boyfriend, he calls him attractive all the time, etc… but I think what’s most telling is your boyfriend expressed to you that he’d be open to hooking up with a guy if he found him attractive enough.
Everyone is different, but I believe people have a sexual “spectrum.” Like you can identify as straight, but the opposite sex might pique your curiosity although you may not feel enough of a need to act on it.
I would also ask yourself why this may make you feel insecure? There’s nothing wrong with feeling that way, but it may be helpful to think more about why that particular card made you feel that way.