There are two things you need to know about:
Your from directory ends with a "/", which, for rsync actually means /*, ie, /var/*. This makes a difference as to where the "root" of your sync is. In this case, the source is multiple files, not a directory. (equivalent to rsync /var/mail /var/spool /var/opt ... /mnt/var)
You need to specify excludes relative to the root. Note that the root is the topmost file / directory from where the sync begins. Thus, if the source is /home/user/directory then, the root is "directory" not /home/user/directory (rsync doesn't even see /home/user).
Best thing is, do a dry run of the sync, and copy paste what you want to exclude. For example:
(a) rsync -aznp /var/ /mnt/var/ # this means copy all files/directories under /var/ to /mnt/var/
sending incremental file list
mail/
opt/
spool/
spool/rsyslog/
www/
...
Now, your exclude patter has to be www/ (or even better, /www/ to avoid things like mail/www/ also being excluded)
(b) rsync -aznp /var /mnt/ # this means copy the directory /var to /mnt/
sending incremental file list
var/mail/
var/opt/
var/spool/
var/spool/rsyslog/
var/www/
...
In this case, the exclude pattern is /var/www/
In summary, you have two opttions to get this to work:
rsync -avzp --exclude=/www /var/ /mnt/var/
OR
rsync -avzp --exclude=/var/www /var /mnt/var