I’m not a lawyer, but I think the “terms of service” for Spotify are more restrictive than is generally assumed. For a definitive answer you would need to trawl through this lot: https://www.spotify.com/us/legal/end-user-agreement/
Of course you are entitled to use their Listen offline service (downloading playlists as DRM’ed cache that you can listen to in the Spotify app).
Downloading in that limited sense is not the same concept as recording (transferring by playing) which is stated as not permitted in the terms of service.