The only problem I can see with asking someone directly is that they might be gay but not 'out' (either in the workplace or in general). So being put on the spot like that might cause them to feel pressured to come out or to deny it entirely. As everyone says, it is the guy's own business anyway. However, I have been in a similar situation with a guy who is my husband's friend and I used to work with him too. I 'knew' he was gay (especially as he always brought male 'friends' along to nights out). I asked my husband if he was - I wouldn't have asked anyone else. My husband didn't know and would never have asked him and I wouldn't expect him to. About a year later, he came out to his closest friends, who included us and then his family. A while after that, he told his work colleagues. Had someone asked him before he was out, he would have been really concerned, especially when he hadn't told his family yet. He's not ashamed, but he was really worried about their reaction.
_________________
"We act as though comfort and luxury were the chief requirements of life, when all we need to make us really happy is something to be enthusiatic about." Charles Kingsley