Hey there, thanks for reaching out.
If you log out while listening to anything on the Spotify App, it should stop playing. However, most of these glitches are fixed using a simple clean install of the Spotify App. Read more about how to perform a clean install here. Also, share a screen record showing the problem you are facing with details like the App version and Device info.
Keep us posted!