From what I can tell, it either helps him think o it's a symptom of his autism. Autistic people do this thing called stimming, where they make a repetitive motion (like spinning o flapping their hands) o do something strange (like sucking their thumb) and it keeps their anxiety down.
It's an Anime about a serial killer and a detective playing a game of cat and mouse. L is the detective. The other guy in the picture, Light, is the killer. And no, I didn't spoil anything. :3
I think it's probably because in episode 10, he says "it helps me think" o maybe it was another episode. He also has bad posture and wasn't cared for as a child, so it could be that his so called "parents" never told him to break the habit when he was a child. That's just coming from little ol' me, an animator. <3