You should quote the TEE assignment:
TEE="2>&1 | tee -a afile"
When you do this:
$ echo 'J. R. Bob Dobbs' $TEE
...the shell will expand the $TEE variable after
constructing the pipeline (which in this case is just a single command), and so the output is:
J. R. Bob Dobbs 2>&1 | tee -a afile
What you need to do is expand the variable first, then eval
uate the command:
eval "echo 'J. R. Bob Dobbs' $TEE"
Note that I changed your double quotes to single ones so that I could wrap the command in double quotes, which permit expansion of the $TEE, while still quoting what should be echoed. You could omit the outer, double quotes, but then you would have problems if you wished to echo something which contained multiple spaces.