If he were to 'come out' - how would that be viewed by the religion you practice?
Is this why he is so stuck? Is that why he is so miserable? He can't do it because it would be deemed 'dirty/wrong' etc.
He knows he is in a place where he can never truly 'fancy' you and he can never feel fulfilled. Yes he probably is gay. He's "done his duty" as per the expectations of the religion, get married, had kids and yet now having followed it to the letter he knows he has a life of emptiness ahead of him on that front.
Of course you just remind him of what a ridiculous and horrible place he is in and when you ask for sex, he is made aware of how 'unclean' he probably is viewed by the religion. He wishes he could do it - but he can't and so he is poisonous to you as you are an easy punch bag and an easy target to blame.
This is very very sad.
I would suggest that a) you begin to find an outside activity that starts to help you feel better about yourself. You need to be mixing with other people who value you and see your worth. That could be part-time work or volunteering somewhere. Both would raise your self-esteem. You are too heavily reliant on what he thinks of you and his opinion of you.
if you could make a first step back into society generally of some sort then you may get the strength to begin to make a plan to leave him. You need outside connections locally if you have no family.
Yes it will be painful but what is the alternative? To stay like this forever? or go through the horror of divorce and a few years down the line be free of him forever.
He is not willing to be strong. You will need to do it for both of you.
I'm so sorry. 