How was Snape killing Dumbledore an act loyalty in Harry Potter and the Deathly Hallows?
There are various possible interpretations.
One possibility is that Dumbledore suspected that Draco would be put in such a position, with Lucius's loyalty in question, and due to Snape's closeness with the family, it's possible that Dumbledore asked Snape to watch over him. The Malfoys, with the help of Bellatrix Lestrange, made this a permanent position by asking him to make the Unbreakable Vow. Without question, Snape told Dumbledore about this, and Dumbledore probably requested that Snape maintain Draco's innocence.
Alternatively, it's possible that Dumbledore had some inkling about the role Draco would play later--with the wand switching authority and so forth. However, it is more likely that the old wizard was concerned with maintaining Draco's innocence.
In killing Dumbledore, Snape did as was asked of him (as it can be assumed), and his murder was therefore an act of loyalty.
Additionally, outside the interpretation of the story itself, in terms of literary devices, Harry Potter's story is a quest, and in quests, the hero must go it alone at the end. It's why Harry goes to the forest by himself, without Hermione or Ron, and why the majority of the adults who helped him along the way had to die (Sirius, Dumbledore, Mad-Eye, Remus, Tonks, Snape, etc.). In effect, Dumbledore had to die, so Rowling relied on this to develop Snape's plot and provide him a role as a hero.
This is what Dumbledore asked for from Snape. Snape was against killing Dumbledore at first, however, he did it in an act of loyalty. Dumbledore explained that he did not want Draco Malfoy to kill because he still had his entire life and had never killed before. Therefore, Snape killed Dumbledore.
That was one of the last things Dumbledore asked Snape to do. Dumbledore wants to die on his own terms and doesn't want it to be on Draco's conscious. Snape didn't even really want to do it at first. He only did such an act because Dumbledore himself asked him to do so.
In my previous answer I forgot to write that Dumbledore had a powerful enchanment in him (second paragraph)
The action of Snape killing Dumbledore is an act of loyalty because of three main reasons.
The first is that Dumbledore was very old, and had a powerful in him, because of using Voldemort's ring (horrocrux).
The second is because Dumbledore himself had asked Snape to kill himself if the time and the moment needed it to be like this.
And the last, I believe, is because Dumbledore new Draco had to kill him, and he didn't want the boy to be a murderer. As well as he didn't want Bellatrix, or the other death-eaters to kill him.
Dumbledore trusted Snape and wanted him to have to kill him.