Bugs' love for light
I think the answer to your question is relatively unknown. The answer I have heard the most often, which is largely the most accepted, is that many insects orient themselves in space using light. So if they are flying at night, the soft light of the moon tells them which relative direction they are going. Light bulbs end up confusing them, because they think they can orient themselves to it, but they are wrong.

http://www.npr.org/templates/story/story.php?storyId=12903572

Additionally, insects do have very similar photoreceptors as humans and vertebrates. Fruit fly eyes are a major research topic because of the similarity of the photoreceptor proteins as well as the amazing genetics that can be done.