First off ...Ricky Martin is a singer and not a songwriter. He did not compose, nor write the lyrics, to many, if any of his hits (niether did Elvis). Draco Rosa, and Desmond Child wrote "Livin La Vida Loca (for example).
Second every generation has a huge fraction of its favorite [ what are taken to be] heterosexual love songs actually written by popular songwriters of the day who happened to have been gay. My parents' postwar generation had the songs by Cole Porter, my own Boomer generation had Elton John, and so on.
The fact that a song writer produces songs for male singers singing about "her" is not evidence of heterosexuality. 