aplay -l >> message.txt 2>&1
There are two redirections going on here. First, redirect stdout to a file '>> message.txt', then redirect stderr to stdout '2>&1' (which is now directed to the file).
The key to understanding how it works it to remember that the redirection happens at the point it is specified. So, if you put the '2>&1' before the '>> message.txt', then you are redirecting stderr to stdout (which is still connected to the terminal), then you are redirecting stdout to the file (that this does not affect stderr, which remains connected to the terminal).