A German former soldier on Monday admitted to spying for Russia at the opening of his trial, saying he had wanted to avoid the escalation of the war in Ukraine.