I don't like flush-mounting semiconductors. Transistors, LEDs, diodes (vertical arrangement), etc. Or any other components really, if I can help it.
There should be lead length to allow for flex, warp and strain in the board, and clearance allows solvent to wash under the component (if the board is being cleaned, especially for a low-leakage application).
Components standing up a bit also allows for hack repairs, like cutting out a failed component and soldering onto the stubs.
Not suitable for everything of course (anything heatsinked through the board, RF applications, etc.), but good as a default method.
Tim