For employment purposes, it is. Court precedents have affirmed that discriminating against someone based on sexual orientation is a form of sex-based discrimination which is illegal under Title VII.
But creative works (like baking a cake or building a website) are protected by the constitution as free speech. You can’t compel someone to perform a creative work against their own beliefs.
That’s why you’re allowed to refuse to build a website for a gay couples wedding, but you can’t refuse to change their tyres.