This has always bothered me. In the comics and cartoons Spider-Man started to lose his powers because his mutation started changing him. In the movie it seemed like it was his self-esteem which makes no sense to me really. Is there any reason why Spider-man lost his powers?
In the movie the reason spidey loses his powers is the more enigmatic part. I will try to explain my take on this by taking a closer look at his scenario step by step.
In the movie we see a relatively younger Spider-Man (people who rescue him from the train fight remark that he is still a kid) who despite his IQ level shown in Spider-Man 2 (for identifying the flaw with Doc Ock's initial demonstration) is still not the financially secure guy because he is in school and delivering pizza (which is not the ideal job when trouble brews in town) and unlike Batman he doesn't have Lucius Fox or Alfred in his life to cover his appearance or managing the financial aspect of his life when he is the vigilante
Because of him being the vigilante his relationship with MJ gets strained initially in the movie and she ends up getting engaged to someone else, Plus the burden of his uncle's death seems to have a bearing on him until he confessed the truth to his aunt and on top of that the very photographs he takes for his work were used to showcase him being the bad guy by the Daily Bugle. These all add up leading to the stress which makes him doubt his own powers and destiny leading him to make the decision to quit being the hero.
So once he makes the decision i assume he wasn't able to exert the control on his powers like he would normally when he has more belief in his ability and the responsibility it carries with it which led him to lose it.
PS: This question has a more open ended scope to it and I would love to hear other opinions as well and I can try to clarify if anyone has any doubts.
Early on in the film, before he's turned into a supervillain, Octavius has Peter over for dinner. His wife, Rosie, asks Peter if he has a girlfriend, to which he answers he doesn't know, prompting Octavius to advise, "Love should never be kept secret. If you keep something as complicated as love stored up inside, it could make you sick."
Peter first shows signs of losing his powers after missing Mary Jane's play and learning that she's seeing someone else. For the rest of the second act, he struggles with both the idea that he shouldn't be Spider-Man anymore and trying to convince himself that he's over Mary Jane.
Then, at the end of the second act, Doc Ock kidnaps Mary Jane. Peter, knowing now that he has to save her, realizes that he cares about her and his powers return.
It's not made clear but in this interview with Sam Raimi (director of Spider-Man 2) he describes the genesis of the power-loss plotline;
“I was thinking about a great issue of Stan Lee’s Spider-Man comic book where he gets the flu. And he, for a time, is really weak. It was so human to me, I thought it was great. This superhero’s got the bug that affects all of us, and just like we all have to go to work when we’re sick and we really don’t know why we’re doing this and how we’re gonna do our job, he had to fight criminals when he had the flu. I thought that was incredibly human, a humanizing thing to have happened to a super hero.
It was a combination of that and a desire to put that into the picture so we could identify with him. I thought that was a unique thing that happened in Stan Lee’s comics ..... That’s where the genesis of the loss of powers came from.”
Although the implication is that in the film his power-loss is largely psychological (as the doctor hints, Spider-Man's inability to fully make use of his powers comes from a psychological barrier and because of his lack of motivation to remain Spider-Man) the fact remains that the plot-line was inspired by the comic "Spiderman : Unmasked at Last!" where his power loss is actually the result of a flu-like illness.
I believe him losing his powers is something purely psychological rather than physical. Peter is shown to have financial trouble, relationship problems, educational struggles, etc and it is all because he is Spider-Man. As we progress through the movie, Peter himself doubts his choice to be Spider-Man with the daily bugle giving him a bad reputation and such. Because of the stress it brings, he begins to then lose the will to be Spider-Man and question why is he doing what he is doing. This is why he loses his powers. Be it that his subconscious is deactivating his powers for his own good or that he just wants to stop being Spider-Man and tries to justify his choice by convincing himself his powers are lost. There are many theories as to why he loses his powers, in which is entirely up to your individual opinion, but they all lead to his subconscious and psychological trauma.
Later on in the movie, he regains his power once again as he now has a purpose once more to be Spider-Man again. He is reminded of the responsibility he has and his subconscious reactivates his powers, as he has now regained the will to continue with his endeavor.
I will try to answer it by my own thoughts. In one line, the answer is: The main reason behind his losing powers was he started to hate himself because he could not balance between his normal life and criminal-hunting life anymore.
This hate was not explicit, but it existed silently in his inner heart. He was economically weak, so he had to sell Spider-Man's pictures reluctantly. He could not attend the classes in a timely manner. He even lost his job in the pizza shop which was very necessary for him. His love life was not successful. So sometimes he felt his life was being wasted serving society, chasing criminals and in the meantime he forgot to think about himself. So he started hating his life (again not explicitly). But we saw when he lost his power, he was not hurt at all. In fact he loved his new life. There was no responsibility for others. He could give time for himself and tried to fill the blanks in his life. As in the movie, the power of throwing webs remain is in his body, so I guess he needed enthusiasm, energy and will power to produce and throw webs. But when he started hating his powers, he lost his enthusiasm, motivation and will. As a result, he lost his power.
But when Octavius attacked Mary Jane, he got back his motivation. So he got his power back again. He got his love back too. He finally understood what it means: "With great power, comes great responsibility!"