What was with the subplot of comics "Tales of the Black Freighter" in the film Watchmen and how is it relevant to the story?
Note: Tales of the Black Freighter is a part of Ultimate cut of the movie.
Now first and foremost, the Tales of the Black Freighter were actually part of the comic source material. So including them in the movie adapation is a natural consequence for a movie production that strived to provide a very accurate reproduction of its source material (but ultimately had to cut such on first sight rather marginal things for a reasonable general theatrical release length). Another consequence of this is, that we can actually take a look at the source material to understand its signficance for the overall story. This is also what I'm primarily be going to do here, since I have admittedly neither seen the Director's Cut nor the Ultimate Cut of the movie (albeit having seen the standalone version of Tales of the Black Freighter). So I'm not entirely sure to which degree it was incorporated into the main storyline and with which surrounding elements (i.e. the newspaper stand and its inhabitants, one of which is a boy reading the actual TotBF comic). But seeing how the movie is otherwise to a large degree a shot for shot adaptation, I have no doubts the TotBF bits are placed roughly at their respective positions in the source material's storyline.
But let's see how it fits into the story. This has in fact already been adressed in a related question over at Comics.SE which concentrated on the source material though, and not on the movie adaptation. The overall consenus is, that the Tales of the Black Freighter show a man that is completely blinded by hatred, fear and despair, which ultimately alters his perception of reality and drives him to commit abominable deeds, upto the very thing he sought to prevent and which leads his soul to ultimately be doomed as part of the Black Freighter he abhors so much, a classic tragedy of a man misguided and dragged into the abyss by his own fears while only having the supposedly greater good in mind.
This is clearly related to the general theme of the comic/movie, which poses the question to which degree the vigilantes who sought to bring justice have not become villains themselves and the question "who watches the watchmen?". And of course, the most extreme example of that is Ozymandias, who killed millions of people in an effort to bring peace to the world. While he had the greater good in mind, he did an inhuman deed of unmeasurable dimensions. And while the question if he did the right thing or not is hard to answer, it is clear that Veidt himself has doomed at least his own soul with that deed, like the captain in the comic. And in fact in the comic there is a very nice little part of dialogue when he talks about his deeds to Dr. Manhattan afterwards, which highlights exactly that and gives a great relation to the TotBF (I don't know if it's part of the Ultimate/Director's Cut, too, though) (emphasis mine):
Jon...I know people think me callous, but I've made myself feel every death. By day I imagine endless faces. By night...Well, I dream, about swimming towards a hideous...No. Never mind. It isn't significant...
There are also other more in-universe connections to the TotBF in the comic, though, which are however of smaller dimensions and are more related to a conspiracy that goes on behind the scenes and is part of Veidt's overall plan, which is a bit different to its movie version, though. So I doubt those connections have been included in the movie.
Another relevance that I feel can probably not unfold its whole effect in the movie adaptation is of a more structural nature. Watchmen has to a large degree also been a comic to play and explore the possiblities of comics themselves, not all of which can be easily translated to the medium of film. And I would say a comic reading sub-plot as part of a comic and an allegory to its main story and motifs is another facet of this exploration, one that might not unfold itself as much in a medium that has come to expect stories within stories. Yet, an animated sub-story is still an interesting (even if not entirely original anymore) feature of a movie that already shines a bit for its originality within its genre.
At the moment this is all largely based on the comic as I couldn't yet get my hands onto the Ultimate Cut of the movie. But I guess most of the answer applies to the movie as well, even if I don't know if it captures all the nuances of the Black Freighter's incorporation into the larger storyline.