Known at La Monja Alférez - the lieutenant nun - 17th century soldier Catalina de Erauso fought as a man for the King of Spain in South America for 15 years. She eventually became famous for her ruse, getting a pension and the right to wear men's clothes.
The Aztec Xochipilli was the god of all things beautiful, like dance, art and flowers. Not surprisingly, he was also the patron of homosexual men and male prostitutes.
Luis Cernuda was probably the first Spanish poet to be open about his homosexuality. He lived a life in exile, which was a major theme of his poetry. He did in 1963 in Mexico.