For those who need a refresher, the opening is below. The sequence I will be discussing occurs between 2:42 and 10:00 in the video.
The film begins with the doctor, played by Bruce Willis, and his wife celebrating his winning of what I shall so blithely call the "Best Psychiatrist Award". After a few monologues and celebratory activities around his winning the Best Psychiatrist Award, we learn there was a time he was not the Best Psychiatrist, when a former patient of his breaks into the house and confronts him wearing only his underwear and carrying a gun.
Now later in the film, we learn this former patient may not have been mentally ill, but may in fact have been seeing real ghosts. However, when the film starts, we don't know that. What we do know is that there a frightening nearly-naked man in Bruce Willis's bathroom with a gun, who was a former patient of Bruce Willis, and accuses Bruce Willis of "failing him." The person we see in those first few minutes we believe to be mentally ill.
It is films like this which are part of the reason why the mentally ill are feared today.
Hollywood is not a medium for subtlety. Forced to keep its films around a two-hour run time, filmmakers have to work to keep the content of the film conveyed clearly and concisely, which means it often has to convey that content in the most explicit and explosive manner possible. To establish Bruce Willis's haunted* past, the film resorts to having a violent and mentally ill former patient say Bruce Willis failed him and then shoot him. The time requirement in conveying that content in a more nuanced and realistic manner (say by showing the former patient in a constant cycle between mental institutions, prisons, and homelessness) is far more risky with keeping the audience's attention than having the patient break into the house half-naked and shoot his psychiatrist. And yet because of that need for efficiency, the mentally ill are further exaggerated and stereotyped.
The Sixth Sense is not an isolated example. The media constantly stigmatizes the mentally ill in television and film, portraying them as violent or otherwise dramatically distanced from society, and while I intend to go into more detail about this later, for now I recommend consulting this and this, among numerous other articles available online, for more exhaustive examinations of mental illness stigmatization in the media. Needless to say, the state of things is far from ideal, and films like The Sixth Sense serve only to further isolate the mentally ill from society and consequently from treatment.
*No pun intended