False confession
Certain people want to give a false confession. They do this for different reasons. In most cases, they want to protect someone who is close to them. There are also some mental conditions that can cause false confessions, for example Histrionic personality disorder. Many legal systems have rules, that people do not need to testify, if this testimony could harm close relatives. This type of false confession  is called voluntary false confession.