I'm using an M1 iMac and AirPods Pro. As far as I know, spatial audio is enabled/disabled under the following conditions:
Music.app : Enabled for playing Dolby Atmos songs downloaded locally from Apple Music (after download to a playlist) / Disabled for streaming or locally files of non-Atmos
Youtube(any video) : Safari / other browsers
mp4 video : QuickTime Player, play in Finder preview or QuickLook / VLC, mpv, IINA
m4a, mp3 locally music files : / completely impossible no matter what I do
As a side note, (I do) in order to add Apple Music songs to your library in Music.app, your music library must be (or converted to be) a cloud music library.
なお以上の情報はTwitterで@muota_hereとして日本語で呟き済みです。