Not to dismiss the fact that the McCarthyism scare was happening at the time of Body Snatchers and was probably at least a subconscious influence for the writer, but this theme of suddenly being socially ostracized is clearly a common fear throughout history. There are a number of significant historical events where something that seems to be a societal norm becomes taboo because of the panic resulting from change. Just to name a few, the Spanish Inquisition, the Salem Witch Trials, the Holocaust, and of course the Red Scare all contained this sort of odd social dynamic. As social beings, we crave acceptance by our peers and we need to fit into certain cliques or groups. Thus, the concept of having the social norms we have adopted and become accustomed to flipped on their head is extremely uncomfortable. Furthermore, the idea of being hunted for the ideas and beliefs that were acceptable the day before is downright terrifying.
I think this is one of the main vehicles of horror in Body Snatchers as well as Goodman Brown. Dr. Miles is obviously highly regarded in town before the incident and seems to know many of the townspeople quite personally. However, by the end of the movie, because he is one of the few unconverted, he is hunted for what he is known for, his personality. The ending of the movie further conveys the horror of being ostracized by society. Much like Young Goodman Brown, there is no solution or happy ending, each main character is left alone and distraught, wallowing in the fact that everything he thought was right is now wrong. Perhaps this movie is not so much a commentary on McCarthyism as it is a very real expression of the human fear that would be experienced by the victims of a witch hunt of that nature.