Constraining the spin-dependent WIMP-nucleon cross sections with XENON1T