Star Wars has finally revealed the real reason Darth Vader had been assigned to protect the first Death Star. As Dark Lord of the Sith, Darth Vader viewed the Death Star with an element of disdain. "The ability to destroy a planet is insignificant next to the power of the Force," he insisted in A New Hope.
Disney's new Star Wars canon has already suggested that Vader's relationship with the Death Star was a complex one. One Darth Vader comic revealed that Vader was jealous of the Death Star; he felt himself to be the only enforcer the Empire needed. As such, Vader was actually part of early attempts to sabotage the battle-station. Vader learned that the pacifistic scientist Galen Erso was key to its operation, and covertly tipped Erso off about the super-weapon he was constructing. Given Darth Vader's secret opposition to the project, though, why was he on hand when the Death Star became operational?
Timothy Zahn's Star Wars novels have finally provided an answer. Two of his books, Star Wars: Alliances and Star Wars: Treason, have focused on an alien race from the Unknown Regions who were attempting to infiltrate the Empire. Both Darth Vader and Grand Admiral Thrawn encountered the Grysk, and in Treason, Thrawn learned that the aliens were raiding the Death Star's supply lines.
The Grysk are a race of slavers. They specialize in breaking a person's will, turning them into a willing slave who would die on their masters' behalf. Thrawn had to consider the possibility that the Grysk had learned of the Death Star's existence, and that they had already compromised Imperial forces around it. His fear was that the aliens would wait until the moment the Death Star became operational, before activating their agents and taking it over. The Empire's planet-killer would thus instantly be in the hands of an alien race who would be focused on conquering the Empire.
Thrawn's solution was elegant in its simplicity; he suggested to Grand Moff Tarkin that Darth Vader be assigned to the Death Star at that critical moment. Darth Vader was the one man Thrawn believed would not break to the Grysk, and the Grand Admiral was also confident his mastery of the Dark Side would warn him of any treachery. Naturally, Thrawn never properly explained his reasons to Tarkin; he simply proposed Vader's presence as an extra level of security. The Grand Moff liked the idea, not least because he and Vader already had a strong working relationship, and so he in turn went to the Emperor with the proposal. And so, the Death Star got an additional line of defense - even if Darth Vader's heart probably wasn't in it.