Its a cartoon anything can happen is all I can say. If you take cartoon seriously there is a problem. And no hes not gay, hes just nerdy. And to answer your question yes he is a male. SpongeBOB is his name. I dont know of many female Bobs.
well it depends but really i always think hes both of the same but the truth is hes a boy i mean he acts like a boss and boys mostly do that (btw that doesnt mean girls are better then boys or boys are better then girls) plus mr.krabs calls him boy in conclusion he acts flirty with sandy and in one of the episodes the crew calls him stupid boy besides one of the episodes he trys to act like a girl but if he is a girl he is gay