How can I move or replicate my Apple Music iTunes Cloud Library to Spotify?
Though I haven't used it personally, the online service Stamp claims that it will transfer your "tracks and playlists across various services," including Spotify and Apple Music in either direction.

It looks like, assuming you want to move more than a handful of songs, it costs €9 for a license. Reading through the iTunes and Play Store reviews for the mobile versions, it looks like most of the negative reviews are just people who didn't realize it's not free, though some people say that it's fairly slow or doesn't do a very good job of matching up the tracks between services.