Napster was found to be guilty of illegal activity because people were downloading content to store on their computer. Similar but torrent website operate in the same way and many of these are being found guilty of infringing on copyright laws as well. Spotify does not allow users to download content.the content available on Spotify is available only through streaming service, so the files are not able to be stored on the computer.
Spotify charges a fee to users and charges advertisers, so they are able to pay artists for the use of their content. Streaming services are not illegal because artists still get paid, whereas Napster was violating copyright laws.