In Christian traditions, "sin" and "death" are depicted as black figures associated with the night, evil, and darkness. Huck isn't religious and doesn't much care for the Bible, but, as we've seen, he's comfortable using its stories and imagery for his own purposes. Here, he equates darkness and sin to enhance the feeling of foreboding created by the storm and to suggest that there's danger ahead.
Twain uses this simile to compare and contrast Huck and Jim with the robbers, who are now presumed dead. That they sleep like the dead robbers emphasizes their similarities and that they let the three men die just as the robbers were going to let Turner die. At the same time, this use of the simile hammers home the fact that Huck and Jim are different from the men, because similes require that two different things be compared. Therefore, the runaways are not the same as the robbers, though some of their actions are similar.