While answering this question I found some strange behavior for which I have no explanation
for /f \"delims=\" %a in (\'(for /l %z in (1,1,10^) do @echo %z^)
Redirection operators apply to the command they are closest to--not the entire line.
In your three test cases, you're redirecting the stdout of the echo and set commands to a file. By redirecting stdout, there is nothing left to pipe to more or sort.
In your nested for loop example, I think there are some unneeded parentheses causing the headaches. Try this instead:
for /f "delims=" %a in ('for /l %z in (1,1,10^) do @echo %z^|sort') do @echo %a0