You are proceeding with the assumption that most (or a great deal) homophobia proceeds from religious grounds; from moral objections grounded in the teachings and writings of many religions who appear to condemn homosexuality. I’ll address that issue, regardless of the truth assumption. The vast majority of America’s (and the world’s) population is religious. Athiest (and agnostic) people therefore are surrounded by religions people (and often raised by them), and pick up many attitudes from said religious environment. One of those attitudes can easily be homophobia. One could also argue that the predomninant culture itself is homophobic, regardless of religiosity, and those attitudes are learned by athiests and agnostics. As a final point, many current atheists and agnostics were not born and raised as such, and may have picked up homophobia from that upbringing too, and failed to discard their homophobia with their faith.