The married friend should not have booked this without first asking you if you were okay with this. Honestly, I don't understand why you didn't each handle booking your own rooms, in order to avoid this. I would never expect someone to book a room for me, especially if there are situations, like this one, that I'd want to avoid. What if he had chosen to book a large king sized bed for you two to lie on, for example? You could also have booked a large suit with individual bedrooms and beds (a/k/a doors for each room) to avoid this situation, if it made you uncomfortable. I am sure there were other options, maybe a different hotel, if that one was fully booked, a motel, a Travellodge type of place, or a nearby AirBnB (which I had to rely on when all the hotels in Atlanta seemed to be booked due to Hurricane Irma)...like I said, there ARE options if such situations suddenly arise.
If I had a steady boyfriend, fiance or husband, I would hope he and I would be comfortable enough to trust each other and mention the hotel room arrangement and take into account each other's feelings BEFORE going ahead with it. I would hope we could trust each other to not become sexual, especially behind each other's backs, and with our kids around. However, if he said he was not okay with this and I really loved him and wanted to keep our relationship strong, I would respect his feelings and tell the friend we cannot share a room as it makes my significant other uncomfortable and therefore, I am not okay with it either. I wouldn't wait until after it happened or it would probably cause a blowup and make him suspicious, and honestly, I wouldn't blame him for feeling that way. Why hide if there's nothing going on? A lack of communication and disregard of others' feelings is EXACTLY why so many relationships fail these days. Don't let that happen to yours.