Board Thread:Legitimate Canon Questions/@comment-24821146-20150723133321/@comment-4091815-20150723161051

Stiles, Scott and Allison all "opened a door" in their minds during the surrogate sacrifice in Alpha Pact.

Deaton posits that the door remained open a bit and urged them to close off that part of their minds.

Allison and Scott merely suffered hallucinations but Stiles mind remained open and the Nogitsune fought it's way inside. There is no canonical reason, just fan speculation, as to why it entered Stiles and not the others.