First, forget the Sonos haters, there are many issues to debunk and some to consider, but too much for a quick note. (As an aside, Sonos is a mainstream solution for middle-market system integrators - installed in many homes in systems costing from $5,000 to $50,000. - they are not just another tiny consumer company that may not be on the Best Buy shelves next year - they have staying power and widely deployed).
HomePod versus Sonos is not an easy decision. Both have capabilities for streaming music, multi-room audio, voice assistants, and home automation, but the focus of each product is different.
Sonos is obviously better for any home or environment that isn’t exclusively Apple monoculture, but the choice of HomePod isn’t clearcut for pure Apple-only homes either.
Easiest to use the unique features to narrow the decision tree…
If you want any music service other than Apple, Sonos is the only choice (AirPlaying is not the same thing as direct streaming - HomePod does not support any music service other than Apple). There are tons of people Apple users that do not use Apple Music and still prefer Spotify, Tidal, or other services.
If you need a HomeKit hub and don’t want to use an AppleTV or want the added automation features, then HomePod is the only choice.
If you want to use your own speakers (in-wall, in-ceiling, custom, passive soundbars, subwoofers, etc.) Sonos has the AMP and Port. HomePod only has it’s own built in speakers.
If you want “line-in” capability to connect a vinyl record player (these are popular again), audio from your cable/sat box music channels (or just another set of speakers playing your TV audio), then again Sonos has ways to do that.
If you want a voice assistant - well the choice isn’t clear. Some people love Siri, some people hate Siri and feel she/it hasn’t changed in years, and a lot of people prefer Google for search-intensive voice queries and then there’s Alexa for the most cost effective/widest selection of devices.
For audio quality - it is subjective but from cost/performance, a pair of Sonos Ones running in true stereo is superior to a single HomePod and cheaper, but a pair of HomePod’s is slightly better sounding. But a pair of any other speakers connected to a Sonos AMP - is up to you while HomePod doesn’t allow any other speakers to be connected.
Multi-room music - Sonos has more capacity and controls than Airplay 2. The user interface from Sonos lets you make/break groups, name groups of speakers, and save favorites/playlists. HomePod is reliant on Apple Music which is a bit of a UI/UX jungle, not that Sonos is always better so this is probably very subjective choice.
Sonos is widely supported by 3rd party apps and control systems. There are hardware “Sonos buttons” that can start a playlist with a single press, and most home automation systems from Logitech Harmony to higher priced systems all interface with Sonos.
HomePod integration is restricted to pure Apple-only devices and the automation is more interactive personal shortcuts and controls than true fully automated system-wide sequences and actions.