\middle doesn't add spaces around the symbol it produces and treats it as an ordinary symbol, like when we say \bigg| or even \bigg(. On the other hand it can't be put inside \mathrel.
The problem might arise when when \middle is used in a subscript; one can say either of
\left( something \nonscript\;\middle|\nonscript\; something \right)
\left( something \mathrel{}\middle|\mathrel{} something \right)
and the result will be the same as if we used \mid (of course if we decide that this vertical bar must be treated as a relation symbol). This is for writing macros that use the \middle feature, as in direct input one knows what space is necessary.
\middle\vert, but\middle|seems to do the same. – Martin Scharrer May 05 '11 at 15:07\vertis the same as\|– May 05 '11 at 15:27\vertis the same as|,\Vertis the same as\|– egreg May 05 '11 at 16:04