Okay. In the beginning, God gave all his children free will. Free will to chose things, so life wouldn't be boring. God wouldn't want robots as kids now, did he? He also gave us obstacles in life, like floods, earthquakes, and other things like that. And in my theory, the attraction to another of the same gender is that "obstacle". Now I personally don't think being gay is a bad thing, it's just love, but maybe in the bibical times when the bible was written, the many bible writers felt it wasn't right for man/women to be gay due to the fact you can't have babies with another man/women.
Also, say you found out your son murdered someone intentionaly, wouldn't you give him up and send him to jail? And would you still love him? Yes, and yes, but that's just my way of explaining it.
God works in weird ways, it's just a mystery since this all dates back billions and billions of years ago.