This a very good question and glad that you asked it.
Why docker and not virtualenv?
There are a couple of reasons, but let me first take out of the way the elephant in the room.
I am very comfortable using Docker as it is part of my day to day job. So this makes me much more likely to use docker instead of virtualenv.
OK, but that is not the only reason.
One of the nice things about Docker is the ability to create Docker images with a copy of the exact dependencies and code that are needed to execute a program. These can be deployed on any compatible hardware that is able to run docker containers. Docker containers are almost like VMs but not quite. They give you isolation such as what a VM gives you, except that containers share the same operating system and overall resources. But containers still give you enough isolation to allow you to not have to worry about incompatibility with libraries already installed in the host OS.
Virtualenv also allows you to install python libraries without having to worry about python libraries already installed in the host OS. However the isolation stops with Python dependencies. Anything else you might have to install in the OS, or perhaps change in the overall OS configuration, will not be isolated and it is hard to undo. Also there is a setup process required when you try to run something in virtualenv. At least from my limited experience using it.
So from my point of view I prefer Docker because it allows me to share with the community what I have done without requiring anyone to go through an overly complicated setup. All you need to do is download my docker container and run it on the PI. It should be that easy. And when you are done with it, you can stop it, and delete it without leaving much of a trace.
Hope I was able to answer your question? Let me know your thoughts