Some people do this for the same reason that they eat tide pods on you tube. Some people tango, others waltz, but most just shuffle once or twice and fall over.
Other people are legitimately tortured into false confessions by physical or psychological means or both.
Others still are just mentally ill and either believe that they deserve to be punished for something or occasionally they believe they really did the thing they're confessing to.
And possibly worst of all, some people make false confessions so that they'll be arrested and get some of Maslow's basic needs met because it's the only avenue available to them to do so.