Again, it‘s a business decision. Spotify deciding not to use Apple’s API, for whatever reason, is a business choice.Relative to the number of Spotify users who own HomePods, which is probably not many since the HomePod was for most of its lifetime an Apple Music centric device that only worked natively with Apple Music.
It's great Apple magically opened it up to competing music services (after dismal sales, antitrust investigations and law suits that had nothing to do with... Cupertino did that because it was what was good for customers right?). But that late move did not exactly draw in masses of people to buy HomePods.
I'd wager that IOS Spotify users that have HomePods is low single digits - south of 5%.
Spotify Connect requires a few simple lines of code that are painless for speaker brands to implement, and Spotify takes it from there with a very well built out platform for switching speakers, rooms, etc across pretty much every brand except HomePod.
It's not as easy as "use Apple's API." For one, Spotify is the only servie that has technology like this which is a whole platform they have built out. You can't just connect Appholes API to it. If someone has speakers form 4 different brands that all work with Spotify Connect, those all show because all those speakers are visible through Spotify Connect on the same wi-fi network. The Apple API is stand alone, does not play well with others like it's maker - and could even possible require a special version the Spotify App just for HomePod users. No one is doing that for a small number of users. While I'm sure they could find a way to shoehorn the Apple API in there somehow - it would be messy and require a lot of resources. Apple is surely not making it easy to integrate their speaker into a well-built cloud based ecosystem.
That choice doesn’t make Apple the “bad guy”. Business, and life in general, is not quite so binary.