Teddy's wife drowned his three kids, and as a result, he shot her. This experience sent him into denial where he wanted to deny what happened and live in a different reality.
Teddy became mentally ill and became unable to tell reality from imagination. He was sent for treatment, as a patient, to a mental hospital on an island where the movie's events take place.
Teddy was unaware of his illness. Instead, he believed he was sent to the hospital to investigate the case of the disappearance of a patient called Rachel.
The doctors at the hospital decided to play along with Teddy's imagined reality in order to prove to him that he is mentally ill. Chuck, who was also a doctor, was playing along with Teddy just to help him realize that he is mentally ill.
Dr Cawley confronted Teddy with his mental illness and told him that his real name is Laeddis and that he used the letters of his real name to construct another name which is Teddy Daniels to create a distance from reality and his real name.
Noyce was another patient in the hospital who was severely attacked by Teddy after he called the latter by his real name. For Teddy that was an attempt to remind him of his true reality and this is why he attacked Noyce.
Dr Cawley told Teddy that the other doctors wanted to lobotomize him and that he can't stop it if Teddy doesn't accept reality and admit that he killed his wife.
Teddy didn't want to take responsibility for the death of his wife, for this will also mean that his kids died because he didn't pay much attention to his wife's mental illness.
Teddy, who was confused between the imaginary world and reality, decided to accept his fate and to get lobotomized instead of admitting that he was responsible for the death of his wife and kids.
In the final moments of the movie, Teddy asked Chuck whether it’s better to live as a monster or die a good man. Teddy's last question to Chuck made it clear that he knew that he will be lobotomized.