How do I avoid inadvertently switching workspaces?

Solution 1:

There's a hidden preference for adjusting the delay in seconds:

defaults write com.apple.dock workspaces-edge-delay -float 0.5
osascript -e 'quit app "Dock"'

It can be set to an arbitrarily high value to disable dragging windows to other spaces.

Solution 2:

TinkerTool has this option in the Applications tab, Mission Control, Delay when dragging window to adjacent space: Default / Short / No Delay.
No Delay was selected on my computer, but I don't remember if I chose that at some point. I looked into this because I wanted the "windows aero snap" feature, I just found and installed Cinch by Irradiated Software. The Spaces "swipe" would happen before Cinch was able to do its thing.