I've only ever used the 4-leg variety. My first impression is that they have more mechanical strength in how they mount to the PCB. The 4-leg parts also have legs that are bent so that they stay in the holes before soldering. You can flip the board upside down without the switch falling out.
The picture of the 2-leg part seems to show it is a old style thru hole, which is more difficult to work with. You can't flip the board over after insertion and before soldering, and then you have to clip the leads on the bottom. That all adds steps and cost. This is probably why the 2-leg parts are rare compared to the 4-leg parts. Check price and availability at a few mainstream distributors, and you'll probably find the 2-leg versions are a bad idea.