That's more of an accident of history, really. In his own words, Netscape told him to come up with something, anything, quick, and lo JavaScript was born. Had Netscape known that he was a closet homophobe, would they have hired him in the first place?
It's also much easier being an homophobe engineer rather than a homophobe CEO, because of the nature of the role. His technical achievements can be as impressive as you want and have no relation to his homophobia; being CEO is a role built on public relationships inside and outside the company, relationships that would be severely influenced by his (perceived) homophobia.