Well yes you can be both religious and gay. A lot of Christians out there (I'm not that educated on many other religions so I can't speak on their behalf) use the bible and its teachings as more of a metaphor for living a correct life and don't take it literally.
I learned recently that one of my devout Christians believes that abortion isn't completely condemned in the bible and its just some people choose to interpret it that way.
Also every passage/chapter which has anything condemning of gays also has very questionable ways of treating women, wearing types of clothes, and etc that we, as a society, have chosen to develop from and ignore yet a small group of Christians pick and choose the passages. (I'm not sure that this final paragraph makes any sense

) basically, if you want to take the bible literally in every sense then technically you're opposed to the notion of being gay but you can also choose to use the bible as a foundation for building a moral character who will inevitably be judged by God.
So yes basically
