I can understand how you feel, but you should not consider that you were stupid to ask for support and understanding from a friend. That's what we need to do - reach out for the help we need. You may well be feeling vulnerable right now because of his initial comment and because now the secret is "out".
His first comment was unkind and careless, but remember that when we tell people this kind of thing they are usually totally unprepared for it. They don't know how to respond, and as a result what they say may at first be very far from what we needed to hear.
From what you say, it seems to me that your friend realized that he had replied inappropriately. He came to you later and asked if you wanted to talk, and then later again he expressed concern that this will affect your friendship. Maybe I'm wrong - I wasn't there, of course. But it sounds to me like he was just totally taken by surprise at first, but now wants to be there for you.
Nobody living can ever stop me
As I go walking my freedom highway.
Nobody living can make me turn back:
This land was made for you and me. (Woody Guthrie)