The “default” LTspice transistor is idealized. Real ones aren’t that good :)

Transistors are *called* “switches” but they are not literal switches like a toggle switch is – they are not mechanical contacts.

Perhaps inadvertently, you have set up the transistor as a common-base switch, and that has a chance of working acceptably – you just need some load, the output can’t float. 

<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.sstatic.net/dLSvX.png)

<!-- End schematic -->

The component values do depend on the parameters of the transistor, and have to be adjusted in practice. It's not the best way to implement a switch, but it certainly works well enough to be useful for something.

The general idea for common-base switches is having ample amplitude of base drive. Ideally, the base drive would be a current source.

Below are the input, output and control waveforms of the circuit above. The control waveform's amplitude is scaled down 50% to make it fit better in the plot.

[![Plot of I/O waveforms, and the control waveform][1]][1]

The non-linear distortion is about 0.5%. The input, output and distortion residue waveforms are plotted below.

[![Plot of the I/O waveforms and the distortion residue while the switch is on][2]][2]

A more dependable way to implement a bipolar switch would be to convert the input signal to a current, then switch the current between two resistors, and take the output from one resistor only.

<!-- Begin schematic: In order to preserve an editable schematic, please
     don't edit this section directly.
     Click the "edit" link below the image in the preview instead. -->

![schematic](https://i.sstatic.net/enVOe.png)

<!-- End schematic -->

The switching action is clean:

[![The output voltage waveform as the switch switches][3]][3]

The distortion residuals are <0.1%:

[![The waveform of distortion residuals][4]][4]


  [1]: https://i.sstatic.net/3b8An.png
  [2]: https://i.sstatic.net/kFEAA.png
  [3]: https://i.sstatic.net/mZMeu.png
  [4]: https://i.sstatic.net/aUPId.png