" . . . it was portrayed as ugly, evil, sick and the 'cowboy' was disgusted with himself."
I also remember MIDNIGHT COWBOY (& enjoyed it, actually).
The movies in the 60s & 70s became more open in their portrayal of sexuality. However, they differed from current films in that they had a moral voice. MIDNIGHT COWBOY showed the decline & degradation of the character played by Jon Voight. Homosexuality, which he had to resort to in order to survive, was still considered a perversion back then.
Nowadays, homosexuality is sanctioned. The films today are amoral, if not left-wing. I can't think of any I want to see.
It was raw and brutal....but, in my opinion, not gratuitous ....
..It had a moral point/idea which was pursued..