Why would someone confess to a crime they didn't commit?
Police might sometimes use devious interrogation techniques.
The suspect may have felt intimidated by law enforcement during interrogation.
There may have been the use of force by law enforcement during interrogation, or the suspect may have perceived a threat of force.
Compromised reasoning ability of the suspect, due to exhaustion, stress, hunger, substance use, and, in some cases, mental limitations, or limited education. Young people who do not understand their rights and are taught to please authority figures are particularly vulnerable.
The suspect may fear that failure to confess will yield a harsher punishment.