Do bugs love light bulbs because they resemble the stars or is it the sun? How do they sense the bulb? What is the purpose of this "brightophilia" that has evolved in insects?
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.
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.