What do you mean by getting rid of him??? I guess it can be difficult to deal with such a shocking revelation especially since you've developed feelings of attachment to a person. However, please know that your crush will pass in time! You can just try avoiding the man for a while, but if you can't avoid him at all, then try to view of him as a friend. A gay best friend might be even better than another girl friend!
I'm pretty sure if he was gay, he would want to get rid of you. ;P But seriously, if he is bothering you, just tell it to his face that you don't date gay men. If he is your friend however and you cannot just cut him out of your life, then do your best to avoid him for a while, telling him that you're busy, until you are sure that you're emotionally ready to face without any issues again.
If you fell for a married man and didn’t know he was gay, then he is almost certainly bi-sexual, meaning that he is sexually attracted to both genders. If you’re feeling uncomfortable with his sexuality, the best thing to do would be to talk to him about your feelings. Maybe you can ask him some questions that will better help you understand his sexual orientation, and it will give you a chance to let him know if you want to stop dating. You should do this in a way that is non-threatening by just saying how you feel (i.e., uncomfortable) and not insult him for the way he is.