As reasoning for its decision, laws of the following governments of sovereign states were given as listed in The Statesman's Yearbook for 1917 as enforcing military service
The justices were literaly looking for any reason to keep the draft (for an unwinnable war that the pentagon lied about for years)
And yes, the draft is by definition servitude/slavery and is illegal under the 13th.