A US judge has jailed a National Guard member for 15 years after he pleaded guilty to leaking highly classified military documents about the war in Ukraine.