@Dominions Son
You are correct, satire and parody would be protected and would not be a copyright violation.
However, a derivative work that does not qualify as satire or parody, and most fan fiction wouldn't, is as much a copyright violation as as direct copy.
Actually, they can. Which is what careful authors can use to avoid being an issue. In court, they look at four main things in deciding if it is satire or parody, or theft:
1. The purpose and character of the use;
2. The nature of the copyrighted work;
3. The amount and substantiality of the portion used; and
4. The effect on the market of the copyrighted work.
Now authors like Rowling and others use this fourth one to claim that stories of a sexual nature damage the value and integrity of their creations. And that has often been upheld, especially if it is something very explicit or outside of the bounds expected in the stories (say a slash story with Harry and Voldemort getting it on). It also violates the second point, as being a "young adult" creation, not intended as adult. And possibly the further issue of being "child pornography".
Or in some that say lift most of the plot elements from another story, say placing it in the middle of the Star Trek episode "Charlie X", with Charlie Evans and Yeoman Rand getting it on. That violates the third point they use, as you also included a very specific plot that has its own copyright independent of the characters themselves.
But create a completely independent story with only the generic setting and characters, and at least an attempt to make some kind of moral or satirical look at them, and then it becomes protected. That all falls clearly under the first point, which is the "purpose and character of the use".
Like say you create a story, in which the Enterprise visits 4 different planets. And in "stereotypical Kirk fashion", he makes a visit to each one, and gets it on with a different alien on each planet.
Only in the end to have created an "Intergalactic Political Dilemma" as not only has he knocked all 4 of them up, he had a form of "Space Herpes" which then was passed to each of them.
And FYI, that also could try to get called into question, as it was actually used as part of the plot in the 1984 movie "Ice Pirates".
But if I was to write such a story, I think it would be no problem proving to the court that it is indeed entirely satire, with the purpose showing the consequences that could have arisen that were never shown in the series itself.
And good luck even trying to claim that I had "diluted" their copyrighted material. Because in the episode "The Paradise Syndrome", it is made perfectly clear that in such a case Kirk knocked up a gal he met on another planet.
There are a lot of sites out there, offering a lot of advice to fanfic authors. And in general, that is exactly what they suggest. Avoid any overt sexual content unless the original was intended for a mature audience (Star Trek and Game of Thrones good, Potterverse and Twilight bad). Also, never lift actual plots and stories directly from source material, only the characters and settings.
And finally, tell at least some kind of moral or cause and effect story. My little example easily passes that. A story where two cast members from NCIS get drunk and get it on, only to have them be late and miss catching somebody can also apply.
This is also why I will never again do "Fan Fiction". And largely laugh whenever somebody suggests it in the "story idea" threads. At most, I may lift some elements from other "universes", but still weave them into something entirely my own with no reliance at all to existing works (other than almost sarcastic "name dropping").
Can some get into trouble? Of course, but a careful author can easily avoid doing so, as long as they at least have an understanding of the legalities involved.