Among the few weaknesses of vampires, the sun is probably best known.
Though vampires have often been portrayed as nocturnal, sunlight causing harm to them is a fairly recent addition. In fact, most vampires prior to 1900 were relatively unhindered by the sun; Carmilla, Geraldine, Lord Ruthven and even Dracula were able to expose themselves to sunlight without harm.
It wasn’t until 1922 that vampires became wholly nocturnal. The dangers of the sun were first introduced in Nosferatu, which showed us Count Orlok’s death by sun exposure. This death was repeated for Bela Lugosi’s portrayal of Armand Tesla in The Return of the Vampire in 1943–cementing it as certain death for the undead.
Until this point, the only mythologically consistent killer of vampires was fire. In some respects, this provides a connection and justification for the hazards of sunlight. Since sunlight is, in essence, firelight, it makes sense for it to negatively affect vampires.
The ill effect of sunlight on vampires also provides a scientific connection, letting us look at porphyria–a condition that causes the afflicted to be sensitive to sunlight, sometimes to the point of skin blistering on exposure.
The birth of the wholly-nocturnal vampire gave rise to the usefulness of dhampirs–half-vampires, such as Blade–as their mortal half typically protects them from the hazards of the sun. This also creates a clamor for daywalkers in vampire stories, portraying them as something special among their own kind.
In reality, the vampire vulnerable to sunlight should be considered unusual, because daywalking was actually the norm.