From chiral kinetic theory to relativistic viscous spin hydrodynamics