PlayStation Music (or actually "Music unlimited" as it was called) was the only music application able/allowed to run in background while a game was running. Other (hobbyist) music players are not allowed, likely because it would make the available resources to a game less predictable, so harder to optimizer for the console...
As many others, Sony found later that it's not worth it to operate a own streaming service, and probably made a deal with Spotify where Sony provided the initial application, Spotify provided the service and potentially pays some additional revenue share to Sony.
It's a story from a moment in time where every distributor/company thought they could do a better/more profitable music streaming service than Spotify...
Apple Music and local playback supports background play while a game is running. I doubt it's any of this "allowed to" nonsense and simply those other apps just didn't add support for the PlayStation.
As many others, Sony found later that it's not worth it to operate a own streaming service, and probably made a deal with Spotify where Sony provided the initial application, Spotify provided the service and potentially pays some additional revenue share to Sony.
It's a story from a moment in time where every distributor/company thought they could do a better/more profitable music streaming service than Spotify...