Spotify's biggest strength is its music search features, where YouTube Music has a search tool but not like Spotify.
YouTube Music's streaming quality differs from Spotify: the web player in premium Spotify will let you stream AAC at 256 kb/s while YouTube Music can play content at bitrates up to 256kbps AAC.
Spotify has a free version but the ads are quite annoying. Monthly subscription pricing for both is the same but Spotify offers more quality for that price.