This. Anyone who has some slight "weakness" or "oddity", Spider-Man will make fun of it. These might be perfectly acceptable things about them, but could still be psychological weaknesses that affect their self-esteem and strike a chord with their emotional core. And that's what Spider-Man does as one of his fighting tactics: he gets under your skin and gets you all riled up about something either you are already insecure about, or if you haven't been before, he will prey on that aspect and actually turn it into a weakness.
Spider-Man, in that sense, is just like these kids you find at school who will target anything about other pupils just to find something to mock them.
And why does he do that?
a) Partly because that is Peter's personality and he just sees the funny side of life. He's like the comedy routine you see at the beginning of chat shows like Jay Leno, Jimmy Fallon, David Letterman etc where they poked fun of celebrities or other people in the news. It's not that they are malicious. They just find these things funny and play up the droll things in life with humorous observations and comments.
b) Because Spider-Man uses his humour as a weapon against his enemies to dissipate their focus and distract them so that they're acting out of emotions instead of thinking clearly with their heads. Once he's ruffled his enemies' feathers, they begin to make mistakes, or their primary goal becomes just getting their own back on Spider-Man instead of thinking strategically like they might have been before.
Spider-Man without humour in his arsenal is like a Batman without his detective skills. It can be done in the movies, but it is woefully incomplete and lacking.
c) Peter Parker's Jewishness: where life's trials lead to quipping not quitting
I'm pretty convinced, just by Peter's personality he's displayed countless times in the comics, that he's actually a Jewish New Yorker (and he was written and created by a Jewish New Yorker like Stan Lee). Peter not only frequently displays this Jewish self-deprecating humour, but also, when he is down on his luck and oppressed, isn't so whiny and a cry baby. Instead he, as is consistent with typical Jewish humour, makes light of his situation and will almost laugh at his difficult circumstances - if not laughing out loud, then at least having almost a gallows humour approach.
I like this passage on Jewish humour I found on an entry in Wikipedia. This describes Peter and Spider-Man's personality perfectly:
Hillel Halkin in his essay about Jewish humour traces some roots of the Jewish self-deprecating humour to the medieval influence of Arabic traditions on the Hebrew literature by quoting a witticism from Yehuda Alharizi's Tahkemoni.
A more recent one is an egalitarian tradition among the Jewish communities of Eastern Europe in which the powerful were often mocked subtly, rather than attacked overtly—as Saul Bellow once put it, "Oppressed people tend to be witty." Jesters known as badchens used to poke fun at prominent members of the community during weddings, creating a good-natured tradition of humour as a levelling device. Rabbi Moshe Waldoks, a scholar of Jewish humour, argued:
You have a lot of shtoch, or jab humor, which is usually meant to deflate pomposity or ego, and to deflate people who consider themselves high and mighty. But Jewish humor was also a device for self-criticism within the community, and I think that's where it really was the most powerful. The humorist, like the prophet, would basically take people to task for their failings. The humor of Eastern Europe especially was centered on defending the poor against the exploitation of the upper classes or other authority figures, so rabbis were made fun of, authority figures were made fun of and rich people were made fun of. It really served as a social catharsis.
Isn't that exactly what Spider-Man does and part of the exact motivation behind why he constantly makes these witticisms? In battle, he definitely uses it as a levelling device.
And because this Jewish humour is such an integral part of Peter Parker and Spider-Man's personality and his oppression in his own life being part of the driving force behind it (since "oppressed people tend to be witty"), I would argue that being Jewish is actually an essential attribute of his, as much as people argue that Black Panther or Luke Cage's African or African-American heritage is part of theirs. And as such, this is why Peter Parker cannot be portrayed as all these other ethnicities (eg Black, Asian, etc) because then it does take away an essential part of who he is.
But because there have been portrayals in the movies where they have gotten Peter's personality wrong (eg the Maguire movies where he was whiny and non-comical), this leads people to thinking that he's just a generic white male with no particular attributes. But he isn't. His humour is part of his Jewishness and the two go hand in hand.
Raimi got the oppressed side of Peter down pat, but forgot (or overlooked) that this oppression has to have an outlet or release in some way, which is Peter's wit.
Garfield, on the other hand, and the way he was written, didn't get the humour correct either. His humour wasn't coming out of a place of being oppressed or having the typical Jewish attributes, which is why it often came across as mean-spirited. The fact that Garfield's Parker wasn't as down on his luck as Maguire meant that his humour and the way it manifested itself as Spider-Man wasn't really Jewish in nature.
So anyone unhappy about Garfield's humour and thinking that a wisecracking Spider-Man doesn't work is not understanding that it's not that wisecracking and witticism don't work at all per se. It's that it was just done incorrectly and without showing the place where all this humour that is bottled up as Peter manifests itself when he is Spider-Man, because he has to let it out somehow