Apple Music isn't a solo business and doesn't report its figures publicly, so it's not known if its margins would be sustainable if it weren't anchored to its much bigger Software and Services unit, which itself is anchored to an even bigger hardware sales unit.
Spotify pays ~70% of revenue to rights-holders, so unless you assume that Apple is paying a lot more, Apple Music is almost certainly profitable both as a standalone service and as a strategic bundle driver.
And this is because Spotify has a free, ad-based tier that pays way less than the paid premium listeners. Whereas Apple Music is all paying users (ignored the limited free trial)